Jolie, the service-oriented programming language

(jolie-lang.org)

116 points | by todsacerdoti 12 days ago

17 comments

  • karmakaze 11 days ago
    Looking at a Database example[0] doesn't make me want to write this more than using any other framework.

    [0] https://docs.jolie-lang.org/v1.11.x/language-tools-and-stand...

    • naasking 11 days ago
      Maybe it's just a bad example, it doesn't look much different than what I can do in C#.
      • croemer 11 days ago
        Why would you showcase a bad example if there was a better one?
        • naasking 11 days ago
          What I meant is, not every language is better at every problem. It's maybe a bad example to showcase Jolie's strengths.
      • all2 11 days ago
        Maybe we're just fish in water and don't know any different? GP, is there a better way?
  • dlahoda 11 days ago
    has refinement types. these exist in fstar lang and liquidhaskell.

    dependant types are not refinement [0]

    ts and rust have ideas to have them[1], but not so officially

    [0]https://www.reddit.com/r/dependent_types/comments/ay7d86/wha...

    [1]https://en.m.wikipedia.org/wiki/Refinement_type

    • tialaramex 11 days ago
      Also see WUFFS for a special purpose language which leans really hard on refinement to deliver safety with socks-blown-off performance in a specific niche.
  • tsuru93 11 days ago
    I was kinda forced to use it for an university exam.

    The premise was interesting but working with it was bad.

    Maybe it improved in the last 5/6 years, but I doubt it's used for many (or any) real use case.

    • lolinder 11 days ago
      The vast majority of programming languages would be terrible for production code in a real business setting. We share and discuss them here not because we're looking for something to replace the big few languages at work but because the niche and obscure ones often explore very interesting ideas.
  • aleksiy123 11 days ago
    Kinda interesting that there seems to be a few similar ideas with https://serviceweaver.dev/

    I'm guess eventually this will be the way but not for a while.

  • d--b 11 days ago
  • manlobster 11 days ago
    I think it would be better if this was a code generator similar to `protoc` for gRPC, so we don't have to learn yet another implementation language.
    • mhackaroons 11 days ago
      One of the devs here. We plan to release an updated code generator (jolie2java) that will make it easy to do exactly that. (For Java, but Jolie is already designed to support other langs as well in the future.)

      Specifically, you'll be able to use Jolie to write (tech-agnostic) APIs and then implement them in Java, using types automatically generated from the Jolie APIs.

      • liampulles 11 days ago
        This is good to hear - the big problem I have with justifying more niche languages is that I have to ultimately use some niche library at some point that only exists for more established languages.

        I hope you guys try to make a first class transpiled language.

  • Alifatisk 11 days ago
    So it's like ballerina lang? (ballerina.io)
  • phaedryx 11 days ago
    I looked it up because I was curious. Jolie stands for Java Orchestration Language Interpreter Engine.
    • greenthrow 11 days ago
      Seems like a backronym to me.
      • stevenae 11 days ago
        For those who don't know, jolie means pretty in french, and is a common woman's name.
        • afelixdorn 11 days ago
          I don't think I've heard heard of someone named Jolie.

          According to data from INSEE (France's Census Bureau equivalent), since 1925, only 6 babies were named Jolie in 2011 and then 5 more in 2018.

          There's a Joline which you'd pronounce pretty much like jolie as the n is very weak, but it's barely more popular.

          Anyway, jolie does mean pretty, but it's not really a name (11~0 at this scale).

          • rob74 11 days ago
            I'm pretty sure you've heard of at least one person named Jolie: https://en.wikipedia.org/wiki/Angelina_Jolie - but of course she's not French, I guess her parents picked the name because it sounded nice, and she thought it sounded so nice that she picked it as her stage name...
            • soco 11 days ago
              I suppose the parent commenter mistook Jolie for Julie which is indeed a common French (and not only) name.
            • misja111 11 days ago
              Her mother had French-Canadian roots.
            • afelixdorn 11 days ago
              Yeah, but that's a last name. I was talking about first names which is usually what people mean when they say a common name.

              I'm guessing the other commenters are right, GP probably meant "Julie".

              • yencabulator 11 days ago
                Angelina Jolie is a stage name. She was born Angelina Jolie Voight. Jolie is a middle name there.
          • prmoustache 11 days ago
            Yeah Julie/juliette are common as a first name but do not share etymology (comes from julius).

            A more common last name is Joly which is old form from joli, the masculine form of jolie.

        • pgbi 11 days ago
          It does mean pretty but it is not a common french name.
          • librasteve 11 days ago
            on the basis that there aren’t many kids named Pretty by their English speaker parents, surely it’s more likely that a non-French speaker would name their kid Jolie
        • oaktowner 11 days ago
          I knew a woman whose last name was Jolie... Her parents named her Très ("très jolie" means very pretty).
  • ivanjermakov 11 days ago
    > The basic building blocks of software are not objects or functions, but rather services that can be relocated and replicated as needed.

    No? Most software I use is a single service (in a sense that it's compiled to a single executable).

  • FredrikMeyer 11 days ago
    I assume this language is named after Jolie in Avatar The Last Airbender? (https://avatar.fandom.com/wiki/Zhu_Li_Moon - the pronunciation is the same)
    • prmoustache 11 days ago
      Jolie stands for 'pretty/beautiful/attractive' in feminine form in french and is sometimes used as a noon when mentioning a person more often in a condescending manner.
    • mhackaroons 11 days ago
      Whenever Jolie is posted in a forum, the same discussion about its name is recreated.

      It is, however, the first time that I see the 'airbender explanation'. Nicely done!

    • bmacho 11 days ago
      Zhu Li eyes are curvy at the top and straight at the bottom (see the image), while the Jolie eye is the exact upside down of it.
  • cable 11 days ago
    This looks like Mule ESB 1/2.x configuration sans the XML
  • croemer 11 days ago
    Was curious at first but got more disappointed the further I read.

    The docs are overly wordy and in desperate need of editing.

    It claims it's a language, but it looks more like a DSL on top of Java with non-obvious syntax.

    It's been around since 2014? Is it used for anything serious? Or just riding the microservices gravy train?

    • mhackaroons 11 days ago
      It is used in industry, yes, but is still quite niche. For example I know of journalism tools at media companies, document systems, websites, and a payroll system. It's definitely used as a stable platform in a few places but could use more libraries (things are getting active there though, plus you can reuse anything from the Java world).

      The docs really need some love.. : - )

  • hn_throwaway_99 11 days ago
    A lot of this looks similar to what GraphQL with something like Apollo Federation gives you:

    1. A contract-first language where all of your queries (reads) and mutations (writes) are defined in the GraphQL type language.

    2. Refinement types can be implemented with directives or custom scalars.

    3. The "built for the networked age" section is very similar to what Apollo Federation gives you - the ability to move implementations of part of your GraphQL API service to different servers with end clients being unaware.

    4. Protocol agnositic - technically GraphQL is protocol agnostic but in really nobody cares because everyone uses HTTP or Websockets.

  • ChicagoDave 11 days ago
    Definitely worth a look.
  • anentropic 11 days ago
    I can't see past the gigantic tabs
  • xonix 11 days ago

      email:string( regex(".*@.*\\..*") )
    
    This is incorrect regex for email. The correct one is https://pdw.ex-parrot.com/Mail-RFC822-Address.html
    • OJFord 11 days ago
      It's a pragmatic one. It has no false negatives, and there's rarely a reason to care about false positives. (Especially not where a stricter regex would (be the only mechanism to) catch it, but a fake-but-valid address wouldn't trivially bypass it.)
      • boulos 11 days ago
        At the very least, I assume .+ at the start is a better choice.

        The RFC says:

             addr-spec   =  local-part "@" domain        ; global address
             atom        =  1*<any CHAR except specials, SPACE and CTLs>
             word        =  atom / quoted-string
        
        so I think the bit in front of the @ has to be non-empty.
        • OJFord 11 days ago
          Yeah, I agree, I think I'd have written that myself, but I don't think I'd reject it in review on that basis. I don't agree with sibling comment that it's 'shitty', it's trivially improved sure but it basically doesn't matter - if you want it to be actually correct you need to send an email to it for verification anyway.

          Otherwise we can start saying not just not empty, it also needs no other @s etc. and before you know it we're rivalling the actually correct attempt up-thread. If you just want to catch typos, encourage entering real address (not just a space or full stop to fill mandatory field) then any basic thing is something, a compromise between legibility and how much it'll catch, we know there's a tonne of (mainly adversarial) bad input it'll miss, that's fine.

          • boulos 10 days ago
            Agreed. I should have said so, too.
      • petesergeant 11 days ago
        I agree with the sentiment, but this one is just shitty. Switch out the stars for pluses and it’d be a lot better
    • IncreasePosts 11 days ago
      At a certain point I think you're allowed to say you don't care if the person with this email address is capable of signing up or using your service:

      very.”(),:;<>[]”.VERY.”very@\\ "very”.unusual@strange.example.com

      • immibis 11 days ago
        Too bad - if that's my email address and you're rejecting it, I'm going to sue you for denying service arbitrarily and win. Not every country is the USA.
        • petesergeant 11 days ago
          > I'm going to sue you for denying service arbitrarily and win

          Which country are you claiming this entirely implausible legal scenario would work in?

        • DEADMINCE 11 days ago
          The denial of service was not intentional so I doubt you would win anything.
          • immibis 11 days ago
            You'd have to fix your code, at least.
        • wk_end 11 days ago
          Is there a country where this has happened?
        • Touche 11 days ago
          [flagged]
    • warkdarrior 11 days ago
      There is a typo on line 17.
    • UniverseHacker 11 days ago
      That is an absurdly complex regex
      • Twirrim 11 days ago
        Email address specs turn out to be rather complicated.

        I really wish people wouldn't code their own checks rather than use already existing standards. Some languages like Java even include proper checks in their standard library: https://java.net/projects/javamail

        Several jobs back I had no end of arguments with some Java devs about not writing their own checks, that kept routinely failing on legitimate addresses.

        • soco 11 days ago
          But why do you even need to validate that email? Send the subscriber a confirmation link - if they get it then it was valid, if not then it's on them to fix the situation in whatever way they find fit.
        • UniverseHacker 11 days ago
          A single massive and unreadable regex isn't an appropriate way to validate a spec that complex. With its complexity it can't be logically evaluated- only tested, whereas a function that breaks the spec out into steps/parts is going to be a lot more maintainable, readable, and auditable.
        • smrtinsert 11 days ago
          It's all devs in general. As a java dev I have lost count of the number of times I have to tell any dev not to use a damn regex to validate emails.
      • brabel 11 days ago
        It really is, I wonder if anyone has tested that extensively. It's so complex that just by reading it I don't think anyone would be able to confirm it matches the RFC correctly.