News for hackers. Stuff that matters.
Re:Multi-Paradigm Languages by milansuk on Monday November 23, 2020 @09:54AM (#25187296)
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

Re:Multi-Paradigm Languages by ywei3410 on Tuesday November 24, 2020 @05:49AM (#25197269)
It 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/ [2] https://docs.racket-lang.org/datalog/datalog.html?q=datalog [3] https://github.com/lexi-lambda/hackett [4] https://docs.racket-lang.org/profj/ [5] https://beautifulracket.com/appendix/why-lop-why-racket.html

Re:Multi-Paradigm Languages by dgb23 on Tuesday November 24, 2020 @07:34AM (#25197853)
I 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.

Re:Multi-Paradigm Languages by nextos on Tuesday November 24, 2020 @08:33AM (#25198256)
In 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.

Re:Multi-Paradigm Languages by ywei3410 on Tuesday November 24, 2020 @08:45AM (#25198347)
Yes! 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 .

Re:Multi-Paradigm Languages by nextos on Tuesday November 24, 2020 @09:11AM (#25198542)
I think I know some of these papers, but could you please point me to some of the references you have mentioned?
Re:Multi-Paradigm Languages by ywei3410 on Tuesday November 24, 2020 @09:41AM (#25198801)
Of 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

[2] https://www2.ccs.neu.edu/racket/pubs/popl16-tfgnvf.pdf

[3] https://www.youtube.com/watch?v=A4AA8nweYAg

[4] https://www.ccs.neu.edu/~types/resources/talks/g-rcon-2020.p...

[5] https://arxiv.org/abs/2007.12630

Re:Multi-Paradigm Languages by nextos on Tuesday November 24, 2020 @12:24PM (#25200605)
Thank you so much!
Re:Multi-Paradigm Languages by eliasson on Tuesday November 24, 2020 @07:34AM (#25197851)
This 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-programmin...

Re:Multi-Paradigm Languages by pjmlp on Tuesday November 24, 2020 @08:52AM (#25198391)
A 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.

Re:Multi-Paradigm Languages by schwartzworld on Tuesday November 24, 2020 @06:17AM (#25197431)
I 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.

Re:Multi-Paradigm Languages by valenterry on Tuesday November 24, 2020 @07:34AM (#25197856)
Let 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.
Re:Multi-Paradigm Languages by AnimalMuppet on Monday November 23, 2020 @12:28PM (#25189168)
I 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.
Re:Multi-Paradigm Languages by joombaga on Monday November 23, 2020 @12:01PM (#25188831)
The 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).