8 ms·
Elixir allows you to build powerful DSLs within the language using macros and optional syntax. Also, if you write CSS well you end up with a DSL describing your
by andy_ppp 8y ago
Elixir allows you to build powerful DSLs within the language using macros and optional syntax. Also, if you write CSS well you end up with a DSL describing your screens. What other languages give you this power?
- portroyal 8y agoThe Tool Command Language and Toolkit (Tcl/Tk).
- islon 8y agoAll Lisps and schemes?
- draegtun 8y agoWhat other languages give you this power? Rebol / Red NB. Here's an old Wikipedia link listing (some) languages that were good for creating dialects (DSLs) - https://web.archive.org/web/20140708161345/http://en.wikipedia.org/wiki/Dialecting https://web.archive.org/web/20140708161345/http://en.wikiped...
- timClicks 8y agoRed seems deeply underappreciated in my view. Any thoughts on why?
- draegtun 8y agoRed is still at alpha stage of development. I suspect once it reaches beta level then it main garner more appreciation.
- mises 8y agoWhen it last showed up here in HN, iI was very intrigued by it. However, it promises a lot of stuff I think many here have heard other projects make. It seems very ambitious. Documentation isn't the best, which makes it harder (especially due to different syntax). Overall though, I am still a little skeptical it can keep it's promises. (With that said, I hope it does: it looks like it has a lot of potential)
- register 8y agoIt's still an alpha language. I would never deploy something in production with it.
- tormeh 8y agoScala. For better or worse.
- eslaught 8y agoTerra [1]. I used it to create Regent [2] specifically because it takes this approach. [1]: http://terralang.org/ http://terralang.org/ [2]: http://regent-lang.org/ http://regent-lang.org/
- SomethingOrNot 8y agoYou’re affiliated with Stanford? If so, also with the developer of Terra?
- jaggederest 8y agoTo add to the chorus, most ML dialects, Forth, Ruby, Self, Smalltalk, Python, Mozart/Oz, D, Julia, Lua; to a significant extent Perl, PHP, Nemerle, Octave, R, Javascript, shell, even venerable old SNOBOL.
- p0nce 8y agoHence why making a new application-specific, general purpose language is probably not the greatest idea vs building a DSL within one of the languages you mentionned.
- fsloth 8y agoSimplicity is undervalued quality. It's far simpler from the point of view of dependency management, that if one is developing a large codebase in C++, to also have the scripting language be native to that environment, rather than to first create a DLL of the C++ codebase, then implement the FFI to it using e.g. SWIG, PINVOKE, or such, to call the C++ context from one of these "premade DLL" substrates. It's fairly trivial to expose C++ libraries to any other language context, IFF the library is wrapped to a DLL that respects the C ABI. The reverse is not true. You need to have some message passing mechanism in that case (yes, there are several not-so-hard ways to do that but that again, is added complexity).
- p0nce 8y ago> Simplicity is undervalued quality. Yes, and building a library (a DSL) in an existing powerful language that can do it (and there are many as people said in this thread) for exactly what you need, is _vastly_ simpler than making a new language toolchain (which linker? which codegen? which typing?).
- fsloth 8y agoI agree - choose the best tool for the job. As a counterpoint - Implementing an interpeted macro-less lisp is a few thousands of lines of code in C or C++. So if the goal is just to bootstrap some language, the effort is more about typing than design or innovation (just copy the interpreter in chapter 4.1 of Structure and interpretation of computer programs). A stack based language like forth would be even less work.
- chriswarbo 8y agoOOP is based, partly, around the idea of 'mini algebras' (roughly speaking, public interfaces), which are domain-specific languages ( http://xahlee.info/comp/Alan_Kay_on_object_oriented_programing.html http://xahlee.info/comp/Alan_Kay_on_object_oriented_programi... ) Functional programming, especially Haskell, tends to use the term 'embedded domain-specific language' ( http://wiki.c2.com/?EmbeddedDomainSpecificLanguage http://wiki.c2.com/?EmbeddedDomainSpecificLanguage ) Lisps tend to call them DSLs or sometimes "mini languages" Forth calls them "vocabularies"
- draegtun 8y agoI thought Lisps called them "dialects" (same as in Rebol / Red). Couple of other terms i've seen... * Pidgin - An attempt to get away from DSL ambiguity! * Slang - This is what Perl6 calls them
- chriswarbo 8y ago> I thought Lisps called them "dialects" (Lisp) "dialect" seems to refer to a particular implementation/variant of Lisp, e.g. CommonLisp, Scheme, Racket, Clojure, MacLisp, NewLisp, etc. rather than a domain-specific language built in a Lisp. (e.g. searching for "lisp dialect" gives pages like https://www.slant.co/topics/5928/~lisp-dialects https://www.slant.co/topics/5928/~lisp-dialects )
- mratsim 8y agoI've written several DSLs in Nim[1] for emulators & VM, JITs, parallel computing, neural networks and parallel tensor operations. [1]: https://nim-lang.org/ https://nim-lang.org/
- p0nce 8y agoD does that quite routinely too.