8 ms·
Another option is DSL[0]. It takes some time to create a new language and other team members have to learn it, but long-term efficiency will be out of the roof!
by milansuk 6y ago
Another option is DSL[0]. It takes some time to create a new language and other team members have to learn it, but long-term efficiency will be out of the roof!
Also, I think it would be nice, If there was a platform(maybe it exists?), which would connect let's say top 20 languages and it would be super easy to call function/block of code from other languages. Programmers just pick up the right language for the specific part of project.
[0] https://en.wikipedia.org/wiki/Domain-specific_language https://en.wikipedia.org/wiki/Domain-specific_language
- joombaga 6y agoThe platform you're describing is the way I use bash (understood that you're asking for a little more integration than just exec/fork/spawn).
- AnimalMuppet 6y agoI think SWIG (the Simplified Wrapper and Interface Generator, www.swig.org) may be what you're looking for. It can create interface code for calling language X from language Y. I'm not sure it covers all the most popular 20 languages, but it covers a lot.
- ywei3410 6y agoIt does exist and it's called Racket [1] and language-oriented programming. You can write prolog-like languages [2], or Haskell-like [3], or even C-like languages [4]. You can even write BNF directly [5] and you can /call/ these constructs across different languages. Racket makes it /easy/ to play with semantics and syntax. You can feasibly write a language in an afternoon, to solve 1 specific problem. [1] https://racket-lang.org/ https://racket-lang.org/ [2] https://docs.racket-lang.org/datalog/datalog.html?q=datalog https://docs.racket-lang.org/datalog/datalog.html?q=datalog [3] https://github.com/lexi-lambda/hackett https://github.com/lexi-lambda/hackett [4] https://docs.racket-lang.org/profj/ https://docs.racket-lang.org/profj/ [5] https://beautifulracket.com/appendix/why-lop-why-racket.html https://beautifulracket.com/appendix/why-lop-why-racket.html
- dgb23 6y agoI used Racket at some point alongside SICP ~10y ago. I always considered it being a pure educational/experimental/research language. While this is likely a primary focus of Racket, it seems to be there is a ton to be gained from diving deeper into it, so thank you for these resources.
- nextos 6y agoIn my opinion, a promising avenue for programming would be DSLs with restricted semantics + SAT/SMT solving to deliver lightweight formal methods. So, instead of programming in Turing-complete languages, one creates many specialized DSLs with just enough expressiveness. And, in parallel, some automated formal methods. The combination of a DSL and SAT/SMT makes this feasible, which contrasts with automated theorem proving on Turing-complete languages. Racket seems like a good platform to do this.
- ywei3410 6y agoYes! There is some work being done in this space already; by the incredible people at North-Eastern. One of the more interesting parts of this problem is what you do at the /boundaries/ of the different languages with differing semantics such that you don't accidentally introduce bad lemmas. There are a few published papers which study the boundary between dynamic and static type-systems, but the hope was to extend it into gradual-typing between different type-systems .
- nextos 6y agoI think I know some of these papers, but could you please point me to some of the references you have mentioned?
- ywei3410 6y agoOf course — this paper talks about the mechanism which Racket explores to keep the boundary safe [1]. This paper [2] elaborates on some of the performance challenges. 'Shallow typing' by Ben Greenman et al. is available only by video [3] and slideshow form [4]. Finally, there's a really interesting paper which came out this year which uses a verifier to remove the some of the runtime cost [5] of sound gradual typing. [1] https://www.cs.utah.edu/plt/publications/oopsla12-stff.pdf https://www.cs.utah.edu/plt/publications/oopsla12-stff.pdf [2] https://www2.ccs.neu.edu/racket/pubs/popl16-tfgnvf.pdf https://www2.ccs.neu.edu/racket/pubs/popl16-tfgnvf.pdf [3] https://www.youtube.com/watch?v=A4AA8nweYAg https://www.youtube.com/watch?v=A4AA8nweYAg [4] https://www.ccs.neu.edu/~types/resources/talks/g-rcon-2020.pdf https://www.ccs.neu.edu/~types/resources/talks/g-rcon-2020.p... [5] https://arxiv.org/abs/2007.12630 https://arxiv.org/abs/2007.12630
- schwartzworld 6y agoI can think of two examples, only one of which is me being a smartass. Emacs has a feature called org-mode Babel that lets you write scripts where you pipe the output from a block in one language to a block in any other language, but I don't think you could write a sizeable app this way. The slightly more smart-alecky answer is the command line. I work in node, and it's trivial to call an external program and then operate on the output. There's nothing stopping you from writing a program that is a single function in the language of your choice and calling it wherever you want.
- eliasson 6y agoThis is the reason why I am exited about GraalVM and its support for polyglot programming[1] (via the Truffle framework). [1] https://www.graalvm.org/reference-manual/polyglot-programming/ https://www.graalvm.org/reference-manual/polyglot-programmin...
- pjmlp 6y agoA path already crossed by both IBM i and z OS, and the CLR. So while it is great that Java eco-system is going down the same path, we should not forget those that went there first.
- valenterry 6y agoLet me chime in also here. Besides racket, which is a great choice when liking lisp syntax and dynamically typed code, there is also Java which has python-like syntax and allows for amazing DSLs that are typesafe but still easy to use. Probably the best language for DSLs in production, especially if typesafety is important.