4 ms·
> You seem to be imagining a ‘universal-ish intermediate language’ To clarify, I do not mean that each developer would be using a different language -- they wo
by asoneth 5y ago
> You seem to be imagining a ‘universal-ish intermediate language’
To clarify, I do not mean that each developer would be using a different language -- they would all be writing "Python", they'd just using a superficially distinct syntax that each finds most pleasant/familiar/ergonomic.
> Remembering whether blocks are delimited with braces, indentation or e.g. ‘then/end’ is a no-brainer.
I tend to find the same, at least after an initial learning phase. In fact, I sometimes find distinct languages with similar syntax confusing since I subconsciously expect the same behavior and packages too.
Having said that I've taught and TA'd Scheme, Java, Jess, and block languages like Scratch & Alice many years ago, and in those cases a significant number of students found unfamiliar syntax to be a major hurdle, especially if it was one of their first two programming languages.
Also, judging by the volume of online complaints about Python's semantically meaningful indentation, Ada's array indexing, and Lisp's parentheses these kinds of conventions do seem like a concern even for experienced developers.
> one would still have to deal with all the non-language parts of the environment, like the library, packages, the build system.
Right, that would be the point, to be able to use a language's library/packages/build system without necessarily using its original syntax.
- aasasd 5y agoWell, doing this on top of a single language is more feasible, however the Python-Lisp pair is still not the best choice due to Python's strict semantics of separation between statements and expressions: when you generate an AST from Lisp, you'd have some sorta verbose shims in place of Lisp's expression-ic statements—precisely ones that Hy now creates. And vice versa, a coder's normal Python might not map cleanly to Hy. If you're free to invent the languages in the first place, it would be kinda trivial to make several with the same semantics but different superficial syntax—basically just substitute one bunch of characters for another, no need to go via AST even. And these languages can then be transpiled to a single language of your choice, be that Python or JVM bytecode—if the semantics are made to be close enough.
- gilch 5y agoWhat about a Lissp-Hebigo pair? https://github.com/gilch/hissp#hebigo https://github.com/gilch/hissp#hebigo Hissp takes a different approach than Hy. Where Hy has to use shims to pretend statements are expressions, Hissp just targets the expression subset in the first place. (Actually a somewhat smaller subset than that if you're not injecting any raw Python: literals, lambdas, identifiers, and calls.)