Author Topic: Porting Smalltalk/Joy/Nim/J ... on CPC?  (Read 2073 times)

0 Members and 1 Guest are viewing this topic.

Offline Nemo59

  • CPC464
  • **
  • Posts: 29
  • Country: fr
  • CPC6128+
  • Liked: 60
  • Likes Given: 26
Re: Porting Smalltalk/Joy/Nim/J ... on CPC?
« Reply #25 on: 11:09, 25 April 21 »
I'm very interested and curious about your project.
I took some time to explore Turbo Modula on the CPC. It can generate Byte Code or native Z80 code.
A test here (in french) :


https://www.youtube.com/watch?v=nci7r6bi6J8

But I still prefer for the moment to use the good old Turbo Pascal 3. TP3 allows complex data structur, pointers, lot of memory, easy call to asm from pascal, easy call of pascal from asm. I wrote a sprote editor and Gomoku game and have a lot of project

you wrote :
my_table2 = my_table map my_function

Why not NewRpl without all the mathematical stuff?. Very exotic but so powerful! I like very much this langage. It's an HP calculator langage, a very coherent mix of Forth and Lisp.
Your example in RPL syntax is

my_table   « myfonction » MAP
About NewRPL : start [newRPL User Manual] (hpgcc3.org)

For example :

Code: [Select]
{ 1 2 3 4 5 } « 2 * » MAP
will return { 2 4 6 8 10 }


{ 1 2 3 4 5 } 2 *
->
{2 4 6 8 10 }


{ 1 2 3 } { 4 5 6 } *
-> { 4 10 18 }

{ "a" "b" "c"} "Z" +
-> { "aZ" "bZ" "cZ" }

'a+b' 2 *
-> '(a+b)*2'

or

« 2 * » 'Double' STO

{ 1 2 3 } Double
-> { 2 4 6 }


{ 1 2 3 } { 3 2 1 } +
->  { 4 4 4 }


{ 1 2 3 } REVLIST
{ 3 2 1 }


etc.

« Last Edit: 12:48, 25 April 21 by Nemo59 »
CPC 6128+ / CPM+/ Turbo PASCAL v3
https://cpcrulez.fr/auteur-nemo59.htm

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 236
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 162
  • Likes Given: 172
Re: Porting Smalltalk/Joy/Nim/J ... on CPC?
« Reply #26 on: 17:36, 25 April 21 »
Sweet! Modula and TurboPascal were ahead of their time.


Would you be interested by porting TurboPascal on Amsdos? Even better, reusing Orgams Editor, for the following features:
  • On the fly syntax checking
  • Immediate access to
    • erroneous lines
    • label usages
    • label/routine definition
      • with immediate return to call site
      • Persistence across resets
      • A lot more
    Then, I wonder if it would more less or more work than porting a modern language

    [/color]Thanks for the pointers, newRPL looks neat, I love the automatic mapping/broadcasting, but it seems to have to same drawback than Forth: you have to play with the stack.[/color]Don't get me wrong, that is a mind opening exercice, and I encourage everyone to try stack-based/concatenation languages.[/color]But I find it boring in the long run.[/size]
    [/color]
    [/color]Also, I don't believe we should restrict ourselves to tiny languages. The CPC is powerful enough.
    • [/color]
    « Last Edit: 17:38, 25 April 21 by m_dr_m »

    Offline zhulien

    • 6128 Plus
    • ******
    • Posts: 650
    • Country: au
    • aka Vorax
      • 8bitology
    • Liked: 266
    • Likes Given: 260
    Re: Porting Smalltalk/Joy/Nim/J ... on CPC?
    « Reply #27 on: 09:30, 26 April 21 »
    want to work with me to finish the code generator on the VB6 compiler and JS compiler?

    Offline m_dr_m

    • CPC6128
    • ****
    • Posts: 236
    • Country: se
    • http://orgams.wikidot.com/
      • OrgaMS!
    • Liked: 162
    • Likes Given: 172
    Re: Porting Smalltalk/Joy/Nim/J ... on CPC?
    « Reply #28 on: 15:25, 27 April 21 »
    compiler

    Theses projects sound great! Is there a place to follow their advancement?
    For now, my priority is to port a language **on CPC**, not only **for CPC**.
    That is, having the whole toolchain on CPC, including the editor, frontend, compiler, etc.
    IIUC, your compilers would stay on PC.

    Offline zhulien

    • 6128 Plus
    • ******
    • Posts: 650
    • Country: au
    • aka Vorax
      • 8bitology
    • Liked: 266
    • Likes Given: 260
    Re: Porting Smalltalk/Joy/Nim/J ... on CPC?
    « Reply #29 on: 16:35, 27 April 21 »
    well, the VB5/VB6 (extensive subset) cross compiler does the parsing and an interim XML structure... it can parse itself - which was an intention to allow it to retarget, so it could be hosted on a CPC.  there is partial code generation... unfinished.


    the JS (subset) compiler doesn't intend to cross compile itself, has an interim JSON structure.  there is partial code generation... unfinished.


    The VB cross compiler well, VB is not the most popular 'current' language - so hard to find a new audience for it.


    The JS has some newer ideas in it that could allow you to write code once, run it in a browser, and also run it natively compiled on a CPC (when the code generator is finished).


    In both cases, I am not decided on how I want to handle or pass parameters to functions.  I am leaning in JS towards allowing direct register assignment (sacrificing recursion and gaining performance)... what do you think?