Any custom language generator for new language?

56 views
Skip to first unread message

james...@gmail.com

unread,
Apr 29, 2019, 3:32:39 AM4/29/19
to Blockly

I have built my own blocks and added related code generation script under JavaScript generator.  However, I only use my custom blocks in the program, and no JavaScript related blocks required.  Those JavaScript blocks related codes loaded with javascript_compressed.js will not be used.

I'd like to know if there has any starter kit for custom language generator, so that I can build my own language generator without loading those unused logic from other language (e.g. javascript in my case).

Is there any document for building a language generator from zero?

Beka Westberg

unread,
Apr 29, 2019, 10:04:39 AM4/29/19
to Blockly
Hello,

There is currently no documentation for creating a language generator, but I did find an issue about it. Generally the recommended path is to copy pasta one of the provided language generators and then work your way through it converting it to your needed language. That can be trickier if you're building support for a strongly typed language; blockly has support for strong typing but as far as I know there are no examples to work off of (at least no "official" examples).

This is a good post about creating a generator. As well as this, this, and this.

I hope that helps! If you have any further questions please reply!
Beka
Reply all
Reply to author
Forward
0 new messages