These might be too far off the beaten track for you, being non-standard languages with full game library systems, but Mark Sibly's Monkey2 (discontinued for lack of support) is a complex transpiler project written in a very read-friendly language:
... and one of his previous languages, BlitzMax, is continued by others today as BlitzMaxNG, and it uses a frequently-updated transpiler based off the former/similar Monkey language:
He he when looking at it, be critical because I knocked this up. A pro haskeller could probably find a few flaws in it and the JS generated code will not be performant!
The transpiler is in C++/17. The source language is something called NSEEL, implemented in Winamp couple decades ago. The original runtime was a JIT into old-school x87 code. The target language is Microsoft HLSL, specifically it’s for shader model 5 for Direct3D 11.0.
I have little to no background with compiler development, but IMO my transpiler ain’t too bad, and it’s very efficient.
6 comments
[ 3.0 ms ] story [ 26.5 ms ] threadhttps://github.com/blitz-research/monkey2/tree/develop/src/m...
... and one of his previous languages, BlitzMax, is continued by others today as BlitzMaxNG, and it uses a frequently-updated transpiler based off the former/similar Monkey language:
https://github.com/bmx-ng/bcc
Again, easy to read, and the principles are the same for almost any language.
Downloadable distros:
https://blitzresearch.itch.io/monkey2 https://blitzmax.org/
Targets include Windows x86/64, Mac, Linux, Android and HTML5... among others!
[0]https://github.com/jamiebuilds/the-super-tiny-compiler
The transpiler is in C++/17. The source language is something called NSEEL, implemented in Winamp couple decades ago. The original runtime was a JIT into old-school x87 code. The target language is Microsoft HLSL, specifically it’s for shader model 5 for Direct3D 11.0.
I have little to no background with compiler development, but IMO my transpiler ain’t too bad, and it’s very efficient.