Hacker News new | ask | show | jobs
by snprbob86 5034 days ago
JavaScript, and most contemporary languages for that matter, would be pretty poor choices for such a use case. In particular, the concern here is the need for a language that is commands first and expressions second. It's an analogous situation to template languages. Consider Ruby's erb, for example. It's like you took Ruby, made String interpolation the default, and provided an escape hatch to get to full Ruby, not just the limited interpolation subset.

It's kinda sad that the world seems to have forgotten Tcl: http://en.wikipedia.org/wiki/Tcl

In the case of tcl, you invert C functions (or another language with C-style calling conventions) to be callable by default as commands. You then have the [expr ...] escape hatch to toggle back to the non-default programing mode, that gives you expressions, arithmetic, and other general purpose programming language features.

I'd really love to see a Tcl++ type thing. It would be super cool if applications could easily drop a console, like this one from Mozilla, into their app. Bonus points if it comes complete with a help system, UI, completion, etc.!