avatar_GUNHED

Which would be your desired programming language for the CPC?

Started by GUNHED, 20:42, 03 October 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GUNHED

If you could decide which programming language should be ported new to the CPC (for example using SymbOS or FutureOS as platform), which language would it be?

Consider today's possibilities: RAM expansions, mass storage, internet access etc.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

McArti0

CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

asertus

What do you mean by "ported"? Generate code for CPC or to program inside the CPC?

I like the thread about porting small smalltalk, even if did not succeed.. it is really a language I like. Maybe "abusing" extended ram there may be a chance.





retro space

A LUA pico-8 like mode...
I think you could even do the Pico-8 graphics, expand the Gate Array limits to drive the screen 256x256 with 2x2 blocky pixels in 16 colours.
Teaching computer science on a high school with the CPC, P2000T, Spectrum and C64.

GUNHED

Quote from: asertus on 11:12, 04 October 24What do you mean by "ported"? Generate code for CPC or to program inside the CPC?

I like the thread about porting small smalltalk, even if did not succeed.. it is really a language I like. Maybe "abusing" extended ram there may be a chance.


Well, either port it from some system or do a rewrite. Or so something completely new.

The question is which language would be desirable?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

GUNHED

Quote from: retro space on 12:41, 04 October 24A LUA pico-8 like mode...
I think you could even do the Pico-8 graphics, expand the Gate Array limits to drive the screen 256x256 with 2x2 blocky pixels in 16 colours.
Using the CPC in 256x256 pixel mode and four colors can be done by just adapting some CRTC registers.  :)

But which programming language do you mean?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

retro space

I was thinking in 16 colour mode the pixels are rectangular like 2x1, but if you put two of the same colour on two scanlines, you get like 128x128 pixels effectively, in 16 colours.
LUA is a language used by Pico-8, but also by Roblox. It is a bit like BASIC with the structure of Pascal/C
FUNCTION _INIT()
  CLS(0)
END
FUNCTION _UPDATE()
END
FUNCTION _DRAW()
  FOR N=0,15 DO
    SPR(N,N*8,0)
  END
END

Teaching computer science on a high school with the CPC, P2000T, Spectrum and C64.

GUNHED

LUA looks interesting. Would be nice to have a way (either PC or CPC) to work with it on CPC too. 
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

lightforce6128

Locomotive BASIC is a quite good BASIC, although some more modern features like functions and procedures with parameters, blocks of code for structured programming, as well as scoped variables would help. At least "DEF FN" is a beginning.

Assembler is required for many things that needs to be fast. I'm used to the MAXAM assembler as provided also in WinAPE. Again, something like namespaces would be of help here. I know there are other, more modern assemblers that provide more features.

For quite a long time I'm working with C++. The language was developed more or less at the same time the CPC got into appearance. But it has developed from there in several iterations. Modern C++ looks quite different than the older versions. You can see that the language has a longer history: it is far from being monolithic, although there are efforts to clean up the language. I read somewhere that the memory model of C++ and its classes is not well suited for the Z80. The index registers IX and IY would help to build up something, but it will be slower than something optimized for the Z80.

I also I got to know Swift. This is more modern and more monolithic than C++. Its syntax can be surprisingly compact, still providing full type checking.

Finally many compromises would be necessary. The memory is limited. Long source codes with neat formatting as well as descriptive identifiers and comments are maybe too modern for the CPC. On the other hand: Who knows what can be done if the online compression of source code as used by Locomotive BASIC by tokenization is extended to more modern data structures?

GUNHED

http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

abalore

For me it would be Locomotive BASIC but without line numbers and supporting labels, like a mix of BASIC an assembler. It would be relatively easy to do a cross compiler that converts that into standard Locomotive BASIC with line numbers.

Example:

MODE 1:BORDER 0
GOSUB _print_menu
END
_print_menu
LOCATE 1,1:PRINT "MENU"
RETURN

ZorrO

Yeah, and whole screen editor with scroll listing by roll, and instead copy cursor highlight text to erase/copy/paste, and RSX for sprites/scroll/menus, and build in compiler. Oh yeah! Best Basic ever. :)
CPC+PSX 4ever

GUNHED

Quote from: ZorrO on 09:03, 06 October 24Yeah, and whole screen editor with scroll listing by roll, and instead copy cursor highlight text to erase/copy/paste, and RSX for sprites/scroll/menus, and build in compiler. Oh yeah! Best Basic ever. :)
So, for editing: Basically a good text editor with Copy and Paste (we got that at least).
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

asertus

Quote from: lightforce6128 on 01:57, 05 October 24Locomotive BASIC is a quite good BASIC, although some more modern features like functions and procedures with parameters, blocks of code for structured programming, as well as scoped variables would help. At least "DEF FN" is a beginning.

Assembler is required for many things that needs to be fast. I'm used to the MAXAM assembler as provided also in WinAPE. Again, something like namespaces would be of help here. I know there are other, more modern assemblers that provide more features.

I would like a Locomotive BASIC like BBCBasic, that is, including fuctions and procedures as you say, but also chunk of assembler code.

https://oldpatientsea.github.io/agon-bbc-basic-manual/0.1/bbc3.html

xesrjb

,,The pellet with the poison's in the vessel with the pestle; the chalice from the palace has the brew that is true."

poulette73


Bryce

I'd like something like Scratch to get someone younger interested in programming on the CPC.

Bryce.

PulkoMandy

Hello,

I don't really care about which specific language, but I think there are not so many which can run well given the CPC limitations.

Regarding compiled languages, we have a decent choice of these already with BCPL, C, Pascal, and Modula-2. They are stretching the limits of what you can do on a CPC already. I don't expect anything better will come out. It's possible to use a RAM disk to speed up build time, and also write code with "overlays" that could be put into memory banks (so you can have apps larger than the base 64K of memory).

Even for cross-compiled ones, there are things like Cowgol or Turbo Rascal, so no need to spend more time in that area (for me at least).

On the interpreted/scripting languages side, it is not as nice. Basically the choices are BASIC (either the Locomotive one or a few others available for CP/M), and maybe FORTH, LISP or MOUSE. None of these are really compatible with modern structured programming. I think Python, Lua, and other similar ones are all too big (in their current implementations) to be practical.

That's why I'm looking into Smalltalk now. As a scripting language running in a virtual machine, it can make the memory banking largely invisible and handle it for you. So you can write your complicated algorithm and not worry about where to locate the data. Of course, as a downside of that, it will be rather slow (we'll see if it's just a bit slow, or unbearably slow).

A few other things to consider:

Projects like Java Grinder, which is a converter from JVM (Java Virtual Machine) bytecode to assembler. You could then use Java (or Kotlin or Scala or other languages using tje JVM) and convert to assembler. I don't know how efficient it is. Definitely for cross-compilation only.

GUNHED

Well, the CPC can have up to 4 MB of RAM and up to 32 GB of mass storage.
At least most todays CPCs have 576 KB of RAM. So, with that "limitation" pretty much everything can be done. 

Why didn't it happen already?
well, commercial are only used up to 128 KB of RAM, to be able to target more customers.

IMO an well language must be implemented in assembler, therefore 576 KB or RAM is just _HUGE_  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Optimus

Hard to think of any besides C but we already have cross-dev tools for that. Maybe there are C compilers running on actual CPC but haven't tried and don't know how easy or fast they are. Maybe some minimal C with some minimal interface would be fun to try in actual hardware. But at the end of the day you are gonna need that speed. I used to write things in SDCC and I still do sometimes for prototyping fast, but I realize memory grows so fast, it's not hard to switch back to 100% assembly.

I would actual like to search what C compilers already exist that run natively on CPC and if there is an easy IDE/editor + compiler compo to use? But then it would take time off from actual developing things in what I am already used to. I was never the "try every OS or every programming language" guy.

Bread80

Quiche - https://github.com/Bread80/Quiche

It's my own Pascal variant. The syntax is mostly a more modern superset of standard Pascal which removes the 'friction' and rigidity of 70s style languages and compilers.

Still a work in progress. It's currently a cross-compiler running under Windows. I indent to create a command line version with Free Pascal that can run almost anywhere. It's currently generating Z80 assembler compatible with RASM.

I intend to make it self-compilable which should enable an on-device compiler to be created (albeit with a reduced syntax and less good code generation). There's an examples folder which should give a rough idea of the language.

Prodatron


GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

m_dr_m

Some Functional Programming language. And/Or:
* nim
* racket
* SML

reidrac

These are very promising (eh, cross-compilation):

Although I haven't done anything substantial with them. I have too much code already in ASM and C (with SDCC), and it pays off staying with the things I know best.
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse, Brick Rick, Hyperdrive and The Heart of Salamanderland for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

Bread80


Powered by SMFPacks Menu Editor Mod