GSL – a Universal Code Generator
github.com
GSL – a Universal Code Generator
1–10 of 30 posts
Re: GSL – a Universal Code Generator
#2Re: GSL – a Universal Code Generator
#3Re: GSL – a Universal Code Generator
#4I was reading about Pieter after his article the other day and thought this was an interesting tool. https://news.ycombinator.com/item?id=11547212
I'll miss him. (sighs) Wrote that here in case he sees the higher ranked article. He said he didn't want negativity. ;)
Re: GSL – a Universal Code Generator
#5https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&c...
Their website is a slide-show demonstrating their amazing work:
Generating servers from state machines and such:
SMT kernel for portable, multi-threaded, fast code:
http://legacy.imatix.com/html/smt/
Web server (old and new) https://en.wikipedia.org/wiki/Xitami http://xitami.wikidot.com/main:start
One of best middleware ever http://zeromq.org/
Re: GSL – a Universal Code Generator
#6tldr; Define a model in xml, and a provide it a template script and it'll output some text.
Sound like XSLT? yep. With a custom DSL taped on the side for scripting.
Also...
Template-driven code generators that use symbolic insertion to inject
meta- data into a template. This technology makes it much easier to
write new ad-hoc templates. Typical examples are any technology that
produces dynamic web page.
Scripted code generators that use a high-level language to manipulate
meta- data and then inject it into templates. This technology makes it
much easier to write new ad-hoc code generators. Typical examples are
XSLT, GSL and some other scripted code generation languages.
These are just arbitrary terms you're inventing.Lots of template engines support the ability to manipulate the data before injecting it into a template.
Having a special limited little DSL for scripting that is an antipattern, not a good thing.
Lots of people use translation tools (coffee script, typescript, babel, sass, etc) that map from one language to another 'similar' language, even code, and it works well.
I think we can comfortably say that these days, people are pretty happy with the idea of code generation; ...but I think few people will find anything in GSL that is not covered elsewhere, better.
Can you imagine modeling your typescript in XML so you can generate some javascript from it? ugh.
Perhaps there's some use for this sort of stuff in protocol serialization, but you have to do so much of the heavy lifting yourself for it, I'm not sure why you'd bother over an existing solution like protocol buffers.
Re: GSL – a Universal Code Generator
#7That readme is a massive intro that doesn't explain very much at all. tldr; Define a model in xml, and a provide it a template script and it'll output some text. Sound like XSLT? yep. With a custom DSL taped on the side for scripting. Also... Template-driven code generators that use symbolic insertion to inject meta- data into a template. This technology makes it much easier to write new ad-hoc templates. Typical exa…
http://download.imatix.com/mop/introduction.html
https://news.ycombinator.com/item?id=11558465
Note: I used XML and XSLT back then when they first came out. I had to write custom tech in Perl, etc to get them to work and speed was not in the description. While they were garbage, his methods produced Xitami web server that kicked all kinds of butt. Too bad he switched to XML-based tech as that was my only gripe with it.
Re: GSL – a Universal Code Generator
#8I just installed it yesterday so haven't been able to fully suss out how I will use it.
Hintjens also wrote the CLASS style guide/ subset of C usage which is used for ZeroMQ etc. I don't program in C, thus, can't offer an informed opinion about it - but perhaps another HN'er can chime in on the quality of it.
Re: GSL – a Universal Code Generator
#9Re: GSL – a Universal Code Generator
#10Is there a fundamental difference to template systems such as erb? Because I'm having a hard time seeing it (except the academic prose and the subtle horror xml always causes me).
An internal, interpreted DSL can be written to do similar, but I think the point of this tool is to ease the process of writing the DSL itself, and to make the resulting runtime efficient.