CPCWiki forum

General Category => Programming => Topic started by: m_dr_m on 20:14, 14 July 21

Title: Who has tried exotic languages on CPC? (BCPL, Lisp, Prolog...)
Post by: m_dr_m on 20:14, 14 July 21
I've asked the question for Forth (https://www.cpcwiki.eu/forum/programming/forth-on-cpc/),
yet I'd love to collect feedback on any language existing on CPC (possibly via CP/M).


I wish to have a good overview of advantages and flaws of each, and answer questions such as:
* Does it support float / real numbers?
* Does it have graphics libraries?
* Does it general bytecode? z80?
* What is the speed for a given set of reference programs (e.g. the 3d torus here: https://64nops.wordpress.com/2021/01/21/rosetta-sugar-japprends-a-coder-avec-mon-cpc/)
* How good the environment is?
* How likely are you to recommend it at family dinner or to a random coworker?


Nb: @Nemo59 (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4014) has produced some nice videos about Turbo Pascal 3 (https://www.youtube.com/channel/UCT3OneEDDPSVUIIOO1iEcMA/videos).
I believe knowledge in written form would be easier to consolidate and share, though!



Title: Re: Who has tried exotic languages on CPC? (BCPL, Lisp, Prolog...)
Post by: Targhan on 17:58, 23 July 21
One (dumb? unrealistic?) idea, what about creating a new language? Since you know the primary target (Z80), what about a language that would abstract most of it while allowing some syntax that wouldn't completely hide the low level? You could borrow ideas of any other language you like and incorporate them in your new language, without having to care about compatibility or any undesired inheritance.
Title: Re: Who has tried exotic languages on CPC? (BCPL, Lisp, Prolog...)
Post by: m_dr_m on 23:17, 24 July 21
That's a splendid and unrealistic idea I've been working on for years.


Trying to be a bit more pragmatic now, and reaching this goal via incremental, independent and useful (i.e. self-sufficient) [/size][size=78%]sub-tasks :[/size]


(*) On the other hand, the more declarative/functional a language is, the easier it is to apply platform-specific optimisation.
Title: Re: Who has tried exotic languages on CPC? (BCPL, Lisp, Prolog...)
Post by: Targhan on 12:21, 25 July 21
The IR (intermediate representation) -> Z80 compilation phase should be independent from the front-end language.
I don't quite agree with that, for a target as specific as a new CPC language. *If* I had to create a language on CPC, I would try to abstract some things (access to registers, stack, etc.), but not much more. Else any existing solution would be good enough (and none is, in my opinion).
Sometimes, trying to be too clever traps you into a very complex solution, which ultimately will not see the light of day.
Title: Re: Who has tried exotic languages on CPC? (BCPL, Lisp, Prolog...)
Post by: reidrac on 16:21, 25 July 21
May be you already know it, or is not what you are looking for, but I find Millfork very interesting: https://github.com/KarolS/millfork

TL;DR: A middle-level programming language targeting 6502-based, 8080-based, Z80-based and 6809-based microcomputers.

I like the middle-level idea, but when I've been toying with the idea of designing my own language (I may or may have not started already heh), I thought about going as higher level as possible with a more or less optimized runtime. Kind of expressiveness vs quantity of code, and with a functional twist.

Obviously Millfork as a clear advantage and it is basically that it exists and can be used NOW.

EDIT: apologies, this is a cross-compiler, and not a compiler running on a CPC. If what you want is it to run on a CPC, I don't think you can beat Forth.
Title: Re: Who has tried exotic languages on CPC? (BCPL, Lisp, Prolog...)
Post by: GUNHED on 18:53, 27 July 21
One ... idea, what about creating a new language?
Great idea! And we could have a 'frontend' for all CPC-OS (native, SymbOS, CP/M+, etc...).

Would be nice to have:
- Possibility to include Z80 code
- Use memory management
- Simple + powerful syntax