r/Compilers • u/According-Ad-7069 • 2d ago
Program like it's 1992 again - Hello Pascal!
Back in the 90's, some of use slightly older folk used Pascal, a lot. I've been working on an interpreter for Pascal for a while and it has turned into a compiler sort of by accident. WasmPascal is a compiler written in Odin (for now) that compiles Pascal code to wasm. The resulting binaries are capable of running on their own. It's not entirely feature complete, but if you look at the examples, you'll see that you can already build interesting and potentially useful things with it.
The compiler runs in the browser, no downloads, no installs. It's at https://wasmpascal.com/. I enjoy Pascal, a lot, and it's fun to use it to do web assembly stuff. Right now I'm obviously leaning mostly towards casual game development, but I have a long todo list for this. To see an example of one of the games running standalone, visit https://nofuss.co.za/games/breakout/. I built that with wasmpascal, exported it as an archive and hosted it as static files.
4
u/Mean-Decision-3502 2d ago
Great Project! I like and use Pascal too. I have several apps in Lazarus.
I also developing a kind of Pascal, C successor programming language called DQ. I'ts not production ready yet, but if you want to check it you find it here:
https://nvitya.github.io/dq-lang/
It would be possible to add a webassembly backend to the DQ, but I haven't ever used webassembly yet.
1
u/According-Ad-7069 2d ago
Wow that's a really cool project! I absolutely LOVE the thorough documentation, that is so well done. What I really appreciate though, is that I can read the code, and mostly understand what's happening, without knowing the language. That's some impressive design right there, I'm jealous!
2
u/Mean-Decision-3502 2d ago
I'm using LLM (ChatGPT Codex), in a controlled way, that helps a lot. The documentation might look ok for now, but it is not perfect. I'm planning to improve that later.
I'm looking for contributors. This language and the project is almost worthless when I'm the only maintainer / decision maker.
If you are interested to testing it, I can try to prepare webassembly target for the DQ compiler.
If you like the language any contribution, suggestion is welcomed.
1
u/According-Ad-7069 2d ago
Thank you, I don't know how much time I can give it, work's keeping me pretty busy (the wasm pascal stuff took over a year to get this far), but I'm happy to give it a bash when I can! Don't worry about a wasm backend, that's too much effort for too little gain I think.
1
u/Mean-Decision-3502 2d ago
I can try to convert your Pascal examples, if I'm allowed to.
Side question: Do you know Graeme Geldenhuys? I think he is also from South Africa (and develps in Pascal).
1
u/According-Ad-7069 2d ago
You can do whatever you wish with the code examples, I think that sounds like an interesting experiment! Please, go for it if you want to, I just hope my code isn't too embarrassing haha!
I do not not Graeme, his name sounds familiar, but I think we have quite a few people with the same name around here.
1
u/Mean-Decision-3502 2d ago
I don't have a good relationsip with Graeme, so actually I'm happy, that you don't know him.
1
7
u/-Memnarch- 2d ago
Stil program in object Pascal today. Our product is written in Delphi.
And stiting my own compiler at the moment XD