Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hi, I'm one of the authors of Ohm.

> Does Ohm help with type checking in any way?

Not sure what you mean here...are you asking if Ohm has any support for type checking a language that you create using Ohm?

If so, the answer is no -- not yet. But I could definitely imagine implementing a pluggable Semantics that could make this really easy to do for most languages. We are happy to accept pull requests :-)

> Does Ohm support indentation based syntax?

No, it's not (yet) possible to do this directly. Though it can be done with a simple preprocessing step that expands the source code to include explicit indent/dedent tokens.

It's definitely something we'd like to support, we just haven't settled on how.

> Does Ohm handle language composition (eg. JavaScript or CSS inside HTML)?

Yes and no. Right now, the only means of composition Ohm supports is grammar inheritance. This makes sense for things like ES5 and ES6, but not so much for the use case you describe. The problem is that inheritance won't work if you have any name clashes in the grammars.

We've considered something traits-like (http://scg.unibe.ch/archive/phd/schaerli-phd.pdf), but we're not sure whether it's worth the additional language complexity. A simple workaround for the use case you describe is to just parse in two phases: first match the HTML, allowing `any*` inside a script tag, then match the JavaScript inside a semantic action.

If you're interested in more details, you might want to read the paper that we'll be presenting at DLS in Nov: https://ohmlang.github.io/pubs/dls2016/modular-semantic-acti...



Fair enough, and thank you for the info :) It looks like a very interesting project.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: