1. 12
  1. 5

    This was supposed to be a huge selling point of .NET and the CLR. There was a ton of hype around how you could use VB or the new C# language Or J# (replaced J++). Language interoperability was all you heard about.

    However the hopes of all the VB6 shops were dashed on the rocks of reality when they realized VB6 and VB.NET were 2 different languages. Many shops made the leap to C# or slowly bled out with VB.NET.

    Then there was the second great hype wave when languages like Groovy emerged. There was IronPython and IronRuby and a bunch of niche languages including JavaScript for the CLR via the DLR https://archive.codeplex.com/?p=dlr

    When I was teaching they offered a COBOL.NET class sponsored by Citibank bc they were always looking for more COBOL peeps.

    Amazing how much time and effort has gone into these attempts, yet better we are with Java the dominant language on the JRE and C# dominant on the CLR. It certainly wasn’t for lack of effort.

    To me, the jury is still out on Clojure, Scala, f# and the like and their long term impact.

    1. 3

      Scala is more than 10 years old, and JVM is getting optimized to run Scala well (see above). Scala’s long term impact seems secure.

      I am indeed unsure about Kotlin.

      1. 1

        I’m 10 times more convinced on Kotlin’s staying power than Scala’s.

        The latter has demonstrated for 10 years that leadership can’t be bothered often enough¹ to deal with the problems users actually have, instead of focusing on issues they’d like people to have (because the issue is academically interesting, someone is doing his thesis on it, etc.).

        ¹ Except Jason, who has worked tirelessly to improve compiler performance.

    2. 3

      When Java was introduced, one of the promises was that you would soon be able to compile all of your legacy C or C++ code and run it in JVM alongside Java, providing a clean migration path.

      I wonder what the plan for this was. (Was there one?) Running C on a garbage-collected VM reminds me of wasm / JS interop.

      What would we end up with if we started by looking at what a native JavaScript or Haskell compiler would emit?

      I thought I was reading a very long abstract, and was excited to see the answer to this–but that’s the end! I wonder if there are any follow-up papers with concrete ideas for this.

      1. 6

        if you didn’t know about it, look into the Burroughs b5000, it was essentially an ISA written for something very similar to message send / object dispatch semantics. There’s not a lot of concrete data out there, but it was once a contender.

        1. 3

          It’s not exactly the same, but people noticed existing JVM benchmarks (such as DaCapo) are mostly written in Java, wrote a new JVM benchmark (Renaissance) with lots of Scala, and noticed lots of optimization opportunity and made those optimizations.

          1. 3

            Funnily enough, you can today run c or c++ (or, indeed, any language with llvm support) with sulong and graal.

          2. 2

            The challenge is mostly due to garbage collection right?

            The virtual machines all have incompatible memory models, making conversion expensive… so for that reason we just reuse the “serialize things into data-interchange formats and use RPC patterns” from web technologies.

            Interface description languages like typedefs.com (or most prominently protobuf) are meta-languages for having a distributed type-system. AFAICT: Soon we will have session types and linear logic blurring these boundaries even more (coupling systems across RPC boundaries and obviating GC, respectively).

            I’m excited by languages like Datafun; I feel the semantics offered by typed-monotonicity can work as a DSL that combines IDLs with “Workflow engine”-semantics without becoming turing complete.

            Basically the golang+protobuf programming pattern updated with some better type theory.

            The article does do a good job illustrating the problem though (not just GC but the whole memory model; parallelism, side-effects and everything). I will need to read it more carefully, rather than just commenting with my latest collection of buzzwords like this is some HN :)

            1. 5

              I’d almost forgotten writing this article, but I’m still working on the problem. Two of the projects things that I worked on after writing this that contribute bits of the solution:

              • CHERI, gives a way of doing fine-grained isolation within an address space. For example, I used this to provide an implementation of the JNI that doesn’t allow C code to violate any of the invariants of Java (though it can do whatever evil things it wants with its own heap, including running arbitrary inline assembly).
              • Verona explicitly has a many-worlds abstract machine from the start. It’s possible to logically embed a C / JavaScript / whatever abstract machine within a Verona region. With CHERI (or equivalent hardware), it’s possible to implement this very cheaply.
              1. 2

                Thank you for pointing me in the direction of Verona, this document is very interesting!

                1. 2

                  Verona is still very new, though we now have an engineer (Renato Golin, one of the few non-UIUC people who has been working on LLVM longer than me) working full-time on the compiler. I plan on adding a design doc for our interop model quite soon, but the high-level points are:

                  • Libraries, not functions, are the unit of interop. I want a binding for LLVM or libavcodec, not for hundreds of individual functions with no awareness in Verona of their relationships.
                  • Foreign libraries are instantiated in Verona regions. A C++ library has a logically private heap. In some cases, you may choose not to enforce this but it can be implemented with process isolation, CHERI sandboxes, a wasm implementation doing SFI, and so on.
                  • Foreign libraries respect the Verona isolation guarantees. You cannot have a pointer from one sandbox to another, you cannot have pointers into sandboxed process memory (you can have weak pointers, which must be checked on access).
                  • If the compiler can statically prove that a particular call is safe (i.e. all of the memory safety checks can be performed in transformed code) then it can inline a foreign function at the call site (e.g. for accessors), otherwise it must be cross-domain call.