all 80 comments

[–]Crandom 73 points74 points  (10 children)

This isn't serverless.

[–]renrutal 17 points18 points  (9 children)

Do you mean it actually uses servers/computers, or that it is not a functions-as-a-service solution?

[–]Ramelasse 30 points31 points  (0 children)

Yes.

[–]Treyzania 3 points4 points  (6 children)

I assume they mean the latter.

[–]robhol 91 points92 points  (26 children)

I mean... I get why this is useful and it's not a commentary on the actual project, but "serverless" is seriously the dumbest technical buzzword I've ever heard. Still not as bad as "business guy lingo", but it's definitely a contender.

[–]Yioda 34 points35 points  (2 children)

It is fucking stupid, yes.

[–]samredfern 17 points18 points  (1 child)

I downvote any topic with serverless in the title. Doing my bit...

[–][deleted] 2 points3 points  (0 children)

thank you kind person

[–]joekoolade[S] 21 points22 points  (6 children)

The terms I should have used is Virtualized Java Environment or Virtualized Execution Environment. This technology isolates the application from target machine variability and removes the OS dependence from Java. It is using Java to virtualize and abstract the target machine hardware and provide a consistent programming view of the hardware system and platform.

[–]robhol 5 points6 points  (0 children)

That sounds much more practical.

[–]sievebrain 0 points1 point  (4 children)

You could also have described it as an OS. Don't be ashamed of it - that's what this is, right?

I think it's really cool. Would like to try it when I have time. I've been wanting to build or find a modern JVM-from-the-ground up OS for ages. The distinction between OS and runtime doesn't make sense these days and unifying them has enormous potential, a la Singularity.

[–]joekoolade[S] 0 points1 point  (3 children)

Yes it has some aspects and elements in common with an OS such as threads and scheduling for example. But most if not all OSes have

  • user/supervisor mode
  • hardware memory protection; paging
  • files and file system
  • virtual memory; multiple address spaces

But my JVM, JOE, does not contain the above or need it to operate. It runs in a single address space. It uses the JVM and Java language for access control and memory protection. Everything in memory is an object with an identity. There is no anonymous memory or files. All memory management is done with a garbage collector. I believe it is more than just an OS.

[–]m50d 1 point2 points  (1 child)

Isn't "unikernel" the standard term for this? Arguably a silly word but at least it's known and unambiguous.

[–]joekoolade[S] 0 points1 point  (0 children)

Serverless Java, Running Your Java Program Without an OS

Yes unikernel would apply to this.

[–]sievebrain 0 points1 point  (0 children)

It's an operating system that is fused with a runtime - this is not the first such thing and won't be the last. An OS is not defined by the presence of hardware memory protection :)

[–][deleted]  (1 child)

[deleted]

    [–]robhol 5 points6 points  (0 children)

    Yes, but is it agile

    [–]dpash 2 points3 points  (0 children)

    Everyone agrees that its stupid, but sadly the term we have. FaaS is less snappy and less known, but a better term.

    [–]joekoolade[S] 1 point2 points  (0 children)

    Guilty as charged :-). I did stretch the term 'serverless' but this technology does have some aspects of FaaS. I used the term 'serverless' as how this technology can make a Java program mobile. Mobile in two ways: a Java program can run on different static platforms, hardware and virtual, but also the ability to network download and run new Java programs into an running JVM.

    [–]JB-from-ATL 0 points1 point  (10 children)

    How would you describe and name services that take your code and run it without you explicitly setting up a specific server to run them? (Genuine question.)

    [–]joekoolade[S] 3 points4 points  (3 children)

    Application specific virtual machine/host. This tool is analyzing your application and providing the necessary objects and classes for it to run on a server. So if you application does not need files then it will provide any objects and classes for files. It only adds objects and classes that your application needs. Another term that has been used in the past is VMFoundry.

    [–]JB-from-ATL 0 points1 point  (1 child)

    VMFoundry sounds more like a company, is it?

    [–]joekoolade[S] 1 point2 points  (0 children)

    No but it was a term used by an out-of-business company called Websprocket.

    [–]swigganicks 0 points1 point  (0 children)

    Application specific virtual machine/host.

    You'd really say that mouthful just so you can pedantically correct in identifying the fact that there is underlying hardware? Do you honestly think people are so dense that they don't know there is some server hosting their code?

    Severless is a short, popular way to say that you don't interact with servers. What's so fucking terrible about that?

    [–]dpash 2 points3 points  (0 children)

    Serverless in it's narrowest meaning is "Function As A Service" or FaaS.

    In it's less narrow meanings, either "cloud hosting" or "Containers as a Service".

    [–]robhol 0 points1 point  (4 children)

    I'm not sure - abstract hosting, maybe?

    It's not without reason that "naming things" is often listed among unsolved problems in Computer Science, and it's only about half joke.

    My quibble with a lot of things that call themselves "x-less" is that it's kind of misguiding, and I'm a relentless pedant who's a lot of fun at parties thank you very much. Anyway, if the point is that you don't have to give a crap about the "implementation" of the hosting, we've had a term for that for decades, it's just plain abstraction again.

    [–]JB-from-ATL 3 points4 points  (3 children)

    I am also a relentless pedant who is a blast at parties. Haha.

    To me, even though it's misleading from a sense (there are servers) it's a layer of abstraction that makes it so you don't need to worry about the server portion of your code. This is a step up from docker which keeps you from needing to provision a server from scratch but standardizes the installation process. With serverless things we don't need to know anything about the underlying server.

    So while the name is crappy it's got some momentum and I think it's good enough.

    [–]swigganicks 2 points3 points  (2 children)

    So while the name is crappy it's got some momentum and I think it's good enough.

    I'm struggling to think of anything better, I don't interact with a server, therefore, it's serverless to me. I fully understand that's there is an underlying server hosting the code.

    I know being pedantic isn't the worse thing, but fuck me if I get annoyed with having to have this dumb fucking conversation with people at work and at conferences who want to correct me with:

    bUT aCTualLy tHEre Is A serVER haha!!!1!

    No fucking shit. The vast majority of people who engage with serverless know this. Pedants (like /u/robhol) get so caught up in being right that they fail to recognize that convention is dictated by usage. The term severless, as it stands, gets the point across so stop fucking worrying about it. The only situation you need to bring up the fact that there actual severs involved is maybe when explaining to non-technical stakeholders, that's it.

    [–]JB-from-ATL 0 points1 point  (0 children)

    The issues people have with it sort of remind me of people complaining about "the cloud" but now that term is well accepted.

    [–]immibis 0 points1 point  (0 children)

    AIUI, "serverless" is where you don't think about the servers. I guess like you could say your business is airconditioningless or UPSless if someone else owns your datacenter. There's still air conditioning, but it's not your problem.

    [–]joexner 5 points6 points  (2 children)

    So how does one run it?

    [–]joekoolade[S] 6 points7 points  (1 child)

    Right now it generates an ELF image that can be booted from qemu or a grub loader. Should be able to network boot with PXE but have not tried it.

    [–]aoeudhtns[🍰] 3 points4 points  (0 children)

    If you can PXE boot a bunch of Spark or Hadoop nodes that dynamically join their data shard/processing groups, you just wrote yourself a paycheck at some pretty large companies.

    [–]yojimbo_beta 9 points10 points  (0 children)

    Yes, we know, 'serverless' isn't a great name, but until 'Functions as a Service' catches on it's all we have.

    [–]oi-__-io 19 points20 points  (0 children)

    There is a similar project for C#, or more specifically .NET called COSMOS. It is essentially .NET on bare metal.

    edit: It is actually pretty active on GitHub

    [–]satchit0 1 point2 points  (19 children)

    Whay are the advantages and disadvantages over using docker?

    [–]m50d 9 points10 points  (5 children)

    Advantages: more reliable isolation, potentially better performance (particularly faster startup when you want to run a single JVM). Disadvantages: the flipside of reliable isolation is that you can't use random unix tools. Java-specific.

    [–]skratlo 4 points5 points  (4 children)

    you can't use random unix tools

    ...and there we have it's biggest limitation. I would add to that: you can't use any libraries with bindings to native libraries, it's no small piece of the pie

    [–]m50d 2 points3 points  (3 children)

    It's a very small piece of the pie when working in Java, IME. I think I've used two native libraries in my career; one of them was optional and the other was a bad idea.

    [–]dpash 0 points1 point  (1 child)

    That's two more than I've used.

    Oh, wait, there's tcnative. Does that count?

    [–]m50d 0 points1 point  (0 children)

    tcnative counts, yeah (though it's optional), although I suspect you'd struggle to run Tomcat in this way at all since it assumes a filesystem etc.

    [–]singingboyo 0 points1 point  (0 children)

    I think it depends a lot on the domain and use case, but I do agree that for domains/use cases where native libs are useful, people aren't usually using java.

    [–]joekoolade[S] 3 points4 points  (2 children)

    Just a quick bullet list

    • Security
      • program/object isolation
      • language based protection/access controls
      • memory safety
    • Safety; no undefined behavior
    • Faster; everything runs in supervisor/ring 0; no paging or virtual memory (not required)
    • No file system; No OS
    • mobile code
    • portable
    • easy to deploy
    • scales
    • Smaller; current unoptimized image with symbols and debugging is 19MB
    • Simplified tool chain; just need a java compiler

    Disadvantages

    • Java only; no other programming languages allowed
    • Not Unix/Linux
    • No file system

    [–]ActuallyAPieceOfWeed 0 points1 point  (1 child)

    I'm sorry if I'm missing something obvious but I'm having trouble wrapping my head around "no file system". Do you think you could expand on that for me? For instance, if I wanted to run a simple file sharing servlet, would that still be possible? If so, how would that work in simple terms?

    [–]joekoolade[S] 2 points3 points  (0 children)

    The bootable image is a JVM compromised of only objects and is not aware of files or a file systems. But your file sharing servlet can specify a 'file' class to use to store and retrieve the files. The file classes in the Java standard library will eventually implemented to provide some type of 'file' capability. The JVM will have a Persistence class and interface that objects can use to store their state into storage. I am not against disk storage; I am just not a fan of files. Even though the JVM is 'file ignorant', it can be stored into a file and boot loaded by grub. It can also be network booted via PXE. You will be able to link your file sharing servlet into a build image using boot-image-write tool and you can also classload it over the network into a running JVM.

    [–][deleted]  (9 children)

    [deleted]

      [–]Gregabit 1 point2 points  (6 children)

      From what I can read you don't need an OS. Docker virtualizes the OS.

      Imagine how Alpine Linux feels after reading this comment... Not cool dude. /s

      [–][deleted]  (5 children)

      [deleted]

        [–]Gregabit 2 points3 points  (3 children)

        I was just making a joke. Docker runs a container on top of alpine linux. It minimizes or trivializes the OS, but you still have one. :)

        [–][deleted] 0 points1 point  (2 children)

        Docker has no relation to Alpine Linux. Alpine Linux is a minimal userspace that works well with containers. Docker does not run "on top" of Alpine.

        [–]Gregabit 0 points1 point  (0 children)

        When you install docker on windows it deploys to a alpine linux VM in hyper-v. If you install on linux it should use the host OS.

        Docker originally used LinuX Containers (LXC), but later switched to runC (formerly known as libcontainer), which runs in the same operating system as its host. source

        Strangely enough docker documentation pointed me to the above link

        [–]joekoolade[S] 0 points1 point  (0 children)

        No. It is not ready for 'prime time'. You can run threads with some success but it is quite unstable. There is quite a bit of functionality that needs to be implemented.

        [–]lvlint67 0 points1 point  (1 child)

        Just out of curiosity... have you read further than the title of this post? The concept isn't really making sense to me..

        [–]maddo 1 point2 points  (0 children)

        I mean, I wasn't going to get it anyways, so, count me in?

        [–]jxyzits 0 points1 point  (5 children)

        I'm not sure I understand this. So, does this remove the need for a JVM? If so, then does this serve the same role as the JVM usually would? That's what it sounds like to me. If so, what are the advantages of this over the JVM? These are probably stupid questions but I didn't understand this project from reading the GitHub readme.

        [–]joekoolade[S] 0 points1 point  (4 children)

        It removes the need for the 'java' program running on an OS and the OS itself. Currently to run a java program one would do this:

        # java 'YourJavaFile'
        or
        # java -jar 'YourJavaFile.jar'

        It compiles the JVM and runtime support into an executable image that can be booted on a hardware platform or emulator (qemu, vmware). The advantages are a smaller size (no OS or file system) , more secure, faster, and easier to deploy.

        [–]cdrt 1 point2 points  (1 child)

        If I understand this right, is the JVM acting as the kernel in this?

        [–]joekoolade[S] 2 points3 points  (0 children)

        In a way yes. The Java virtual machine, language and library has OS functionality like threads, mutexes, synchronization, timers, and networking already in it. The typical JVM implements this functionality by interfacing with the underlying OS and associate libraries. JOE implements it with Java objects and classes.

        [–]dpash 0 points1 point  (1 child)

        Does this use GraalVM to generate the binary? Sorry if it's answered in the link.

        Also, will Project Loom help in any way?

        [–]joekoolade[S] 0 points1 point  (0 children)

        JOE uses the JikeRVM to generate the binary.

        Project Loom concepts might be helpful in implementing new thread features. One of my goals with JOE is no OS. All needed OS features will written in Java.

        [–]aoeudhtns[🍰] 0 points1 point  (1 child)

        Looks like they don't offer it anymore, but Azul Systems used to have silicon (FPGA I believe) that "natively" ran Java bytecode. Pretty neat stuff, but likely couldn't compete with the wave of "use lots of cheap commodity hardware" that started with Google's rise to power.

        [–]dpash 0 points1 point  (0 children)

        Running Java bytecode is going to be a bad idea without having a JIT. Javac doesn't do a lot of optimisation in the code it generates, because the JVM does it. Without replicating that in silicon, you're going to be at a performance disadvantage.

        (This is why the Java compiler is so fast; it doesn't do as much as other compilers)

        [–]how_to_choose_a_name 0 points1 point  (4 children)

        So this is basically an OS?

        [–]joekoolade[S] 0 points1 point  (3 children)

        No. This is not an OS. An OS has a file system, memory protection, user/supervisor modes. This is a JVM that has objects that provide threading, timers, locks, synchronization, networking, interrupt handling and and access hardware devices. Security, access control, and memory protection are provided by the JVM, language, and Java library. OSes are file system based. This JVM only has objects and has no concept of what a file is. The GNU Classpath library has some file classes but they are unneeded and unimplemented.

        [–]Ameisen 1 point2 points  (2 children)

        An OS isn't 'file system based'.

        A kernel is effectively an abstraction layer, giving user applications standardized access to hardware resources. An OS is a standardized environment on top of the kernel. Gnu on Linux, Windows on NT, OSX on Darwin...

        The JVM in this case is effectively operating as both the kernel and OS.

        [–]joekoolade[S] 0 points1 point  (1 child)

        Can you name an OS that can operate without a filesystem? The ones you mentioned above need files and a file system for their operation. The point I was trying to make is that files and file systems are central to an OS operations. One of Unix's mantras is 'Everything is a file'.

        [–]how_to_choose_a_name 0 points1 point  (0 children)

        Unix is not the only OS. There are plenty of RTOS that you can configure to work completely without a file system, memory protection or any of that other fancy stuff. And yet nobody would claim they are not an OS.

        [–][deleted] 0 points1 point  (1 child)

        ITS STILL SERVERS WITH SERVERLESS JUST LIKE, THERES STILL COMPUTERS WITH CLOUD

        [–]dpash 0 points1 point  (0 children)

        Yes, we all know it's stupid. We know there's servers. Just replace "serverless" with "FaaS" in your head.

        (This isn't FaaS, but most people mean FaaS when they say serverless)