Live data from Hacker News

GSL – a Universal Code Generator

github.com

1–10 of 30 posts

Re: GSL – a Universal Code Generator

#4
post #2

I was reading about Pieter after his article the other day and thought this was an interesting tool. https://news.ycombinator.com/item?id=11547212

It was a good night... I skipped that article as I avoid unnecessary negativity on subjects I already know about. To heck with a depressing piece, ya know? Then, I click on the link to find Pieter wrote it and is about to die. I hoped I'd meet him one day as some awesome project or paper of insights would come out of it. Couldn't be any other way with him as his work was like the enterprise version of Bernstein: series of techs balancing effectiveness, correctness, and speed unusually well. His work was a steady set of attempts at The Right Thing mindset with quite some impact.

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

#5
A great write-up on his theory of model-driven development and the tech that underpinned most of iMatix:

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&c...

Their website is a slide-show demonstrating their amazing work:

http://www.imatix.com/

Generating servers from state machines and such:

http://hintjens.com/blog:75

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

#6
That 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 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

#7

That 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…

See my links in main reply to OP to get the big picture. Far as XSLT, did you meant the 1985-1995 work he did was "just a 1998 technology?" Or the other way around? ;)

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

#8
There is more to GSL than XML processing. GSL was used to write ZeroMQ along with many other pieces of software. GSL can also be used to write FSM (finite state machines) and an earlier variant called Libero, was used to write the very well regarded, Xitami multithreaded web server.

I 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

#10
post #3

Is 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).

It's a language powerful enough to let you design a custom template system, i.e. it's second-order meta-programming, pushing the leveraging potential way farther than most people would even consider offhand. This kind of thing doesn't matter so much when you have a system already described within a few thousand lines, but it gains credence as more of the code consists of business logic and data models - stuff that has its own programming ruleset.

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.

Post reply on HN