1. 20
  1.  

  2. 7

    It’s worth noting that Limbo as a language is surprisingly capable: there’s ADTs, first-class functions, generics, and even pattern matching. Lots of stuff that didn’t get into Go.

    (A lot of this influence might have come from people like Winterbottom and Wadler, who Pike was working with at the time.)

    1. 4

      Hi hello post author here

      These features can be nicely shown in the Limbo By Example series: https://github.com/henesy/limbobyexample

      ADT’s and some decent polymorphism to show, but not presented in the post here :)

      1. 4

        Why is this surprising? Do people actually think Pike left things out of Go because he didn’t understand them?

        1. 9

          Do people actually think Pike left things out of Go because he didn’t understand them?

          No, he just didn’t think Googlers would understand them.

          1. 5

            I read it as it being surprising that such an old, niche, research-oriented language has so many features that only hit a lot of mainstream languages quite recently. Nothing to do with Pike or his ability.

            I’m not sure I find it surprising, though.

            1. 3

              That was my most charitable guess, why would you leave such useful features on the table otherwise? I am surprised he would make a needlessly limited language on purpose if he had been exposed to these features before.

              Maybe u/calvin is right and he didn’t care for these in Limbo either.

            2. 3

              Do you mean Phil Wadler, the Haskell expert? I know he worked on “featherweight Go” which is the first design for generics to have a chance to make it into Go, but it’d be an interesting twist of history if they collaborated decades earlier.

              That aside: I agree, limbo seems stronger than Go in some senses. ADTs are definitely a plus. Dynamic loading and JIT’ing also make a lot of sense if you already are committed to having a GC.

              1. 4

                Hmmm, I think I might have had Wadler confused for Cardelli. Sorry.

                1. 2

                  The generics first Go bear some surprising resemblance to the polymorphism in Limbo!

                  https://github.com/henesy/limbobyexample/tree/master/Generics

                  In particular I’d point out polymorphic functions:

                  # Reverse a list
                  rev[T](l: list of T): list of T {
                  	r: list of T;
                  	for(; l != nil; l = tl l)
                  		r = hd l :: r;
                  
                  	return r;
                  }
                  

                  This is shown with ADT’s as well :)

              2. 4

                The README for purgatorio(1) is fascinating, and makes me sad that computers didn’t go down this path instead:

                Applications written in Inferno’s concurrent programming language, Limbo, are compiled to its portable virtual machine code (Dis), to run anywhere on a network in the portable environment that Inferno provides. Unusually, that environment looks and acts like a complete operating system.

                The interesting thing is the system’s representation of services and resources. They are represented in a file-like name hiearchy. Programs access them using only the file operations open, read/write, and close. The ‘files’ may of course represent stored data, but may also be devices, network and protocol interfaces, dynamic data sources, and services. The approach unifies and provides basic naming, structuring, and access control mechanisms for all system resources. A single file-service protocol (the same as Plan 9’s 9P) makes all those resources available for import or export throughout the network in a uniform way, independent of location. An application simply attaches the resources it needs to its own per-process name hierarchy (‘name space’).

                The system can be used to build portable client and server applications. It makes it straightforward to build lean applications that share all manner of resources over a network, without the cruft of much of the ‘Grid’ software one sees.

                Unfortunately, http://tryinferno.reverso.be/ is down, so it’s difficult to try it without going through the effort of spinning up a virtual machine.

                EDIT: unfortunately, purgatorio(1) breaks when compiling on musl libc which is very likely because the bundles binaries need to be recompiled – I’ll look into this further when I have some downtime

                1. 2

                  The working link is here: http://tryinferno.rekka.io/

                  I haven’t tried building on musl, but it should definitely be possible without too much work as there are BSD ports, etc.

                  1. 2

                    i’m trying to understand whether inferno is a full operating system, or more of a runtime like the JVM.

                    do you ever run inferno on bare metal? or is it always run as a VM?

                    do you always do Limbo development within inferno? or can it be done on Unix or Plan 9, running Inferno only when you run the program like you would with Java?

                    if Limbo/Inferno can be treated like Java/JVM it seems like it could be a viable language for programming modern applications for unix-like systems. would you agree?

                    1. 1

                      i’m trying to understand whether inferno is a full operating system, or more of a runtime like the JVM.

                      Yes ☺ the answer to both of these questions is yes.

                      Inferno is an operating system that runs on top of a virtual machine named Dis.

                      Dis is an infinite-register model virtual machine comparable to the stack model virtual machine that is the JVM.

                      So, you could think of Inferno as a virtual machine like the JVM whose interfaces are exposed in a way which resembles a plan9-like operating system.

                      do you ever run inferno on bare metal? or is it always run as a VM?

                      I personally haven’t, but there are a decent number of bare-metal ports available and Inferno is intended to be able to be run on bare metal. 1

                      do you always do Limbo development within inferno? or can it be done on Unix or Plan 9, running Inferno only when you run the program like you would with Java?

                      I do, but you don’t have to. You could use a Java-like approach.

                      The Limbo compiler is available to the outside world from Inferno via limbo(1) 2 and you could invoke Inferno in a way similar to Java by doing something like:

                      $ limbo hello.b && emu /hello.dis
                      hello, world ☺
                      $ 
                      

                      There are resources for developing for Inferno outside of Inferno. 3

                      if Limbo/Inferno can be treated like Java/JVM it seems like it could be a viable language for programming modern applications for unix-like systems. would you agree?

                      I agree, as would the original authors, I believe ☺.

                      The biggest restriction on Inferno right now is Dis and its bytecode are architected for 32-bit architectures.

                      Migrating Dis or making a new implementation of Dis which is bittage-agnostic is viable, but time consuming and requires resources which have not been allocated yet. 4

                      The good news: if your OS supports multiarch, you can just run Inferno on 64-bit Linux, for example, and there should be no functional difference in usage.

                      1. 2

                        i wonder if limbo could be ported to BEAM or something

                        1. 1

                          Probably, if someone was willing to write a Dis to BEAM bytecode transpiler or a Limbo compiler to BEAM

                          The language isn’t terribly complex all things considered

                2. 1

                  /u/henesy wtf is this animated spa

                  on a plan 9 site?!??!?

                  1. 1

                    This is awesome, never thought I’d see something about Limbo in 2020. Tell me though, why is there anything about programming in Limbo in 2020?

                    1. 4

                      Flipping this question on its head, why wouldn’t there be articles about programming in Limbo in 2020?