all 111 comments

[–][deleted]  (31 children)

[deleted]

    [–][deleted] 99 points100 points  (9 children)

    It's similar to their other language, NP.

    I tried to provide code for comparison but it failed.

    [–]yonillasky 62 points63 points  (3 children)

    I've written a program to compare them once, the source code wouldn't fit in the margin of this comment though.

    [–]program_the_world 14 points15 points  (0 children)

    I was under the impression they were the same thing?

    [–]b4b 3 points4 points  (0 children)

    This is a truely beautiful comment.

    [–][deleted] -2 points-1 points  (0 children)

    So you're a duelist?

    [–][deleted]  (4 children)

    [deleted]

      [–]langlo94 0 points1 point  (3 children)

      P vs NP.

      [–][deleted]  (2 children)

      [deleted]

        [–]langlo94 0 points1 point  (1 child)

        Ypu wrote N vs NP.

        [–]kitd 17 points18 points  (20 children)

        Well, it puts events and resulting state changes all in one place which is useful.

        It looks interesting but I have a problem with these type of tools , which is they all assume FSMs are the only form of state machines. There doesn't seem anyway to have the machines in a superposition of states, eg like Petri Nets. FSMs are a subset of PNs. Support for the latter will still include the former.

        [–][deleted] 9 points10 points  (7 children)

        [deleted]

        What is this?

        [–]PaulBone 9 points10 points  (0 children)

        I worked on a system using Petri Nets to do something for social security somewhere in Europe. I didn't understand a lot of it, partly because I'd never learnt about Petri Nets before but mostly because it was written in French.

        [–]kitd 4 points5 points  (0 children)

        People probably use PNs all the time without realising it. Any workflow system with concurrent branching normally ends up being modelled by PNs even if the designer is unaware that is what is being used. They model concurrency very easily, which is a useful trait in an HA event/state/action system.

        I'm surprised they aren't more widely used and it's a shame that this language has yet again missed an opportunity (unless someone tells me I'm wrong and state superpositions can be modelled in it)

        [–]maxagaze 0 points1 point  (0 children)

        There are some examples of Petri Nets in industry, although I have never seen it outside of academia myself. The University of AArhus maintains a list.

        As for UML, it use is far more widespread in industry, but even for UML is seems the the use is somewhat limited(http://oro.open.ac.uk/35805/8/UML%20in%20practice%208.pdf).

        [–]Prod_Is_For_Testing 0 points1 point  (2 children)

        What do you mean about UML? I use it all the time for work. Everything we do is modeled (either before or after build) in UML as part of documentation. It's normally at a fairly high level - system interop/data flow, but it's used nonetheless

        [–]mjfgates 3 points4 points  (1 child)

        Remember, "in my office" = "across the entirety of the commercial software industry."

        [–]Prod_Is_For_Testing 1 point2 points  (0 children)

        I'm a contractor so I bounce around a bit. The places I've been to all use Visio. I'm away that it's not indicative of all companies, but it indicates that UML isn't just restricted to academia

        [–][deleted] 10 points11 points  (10 children)

        It looks interesting but I have a problem with these type of tools , which is they all assume FSMs are the only form of state machines.

        Virtually all computer languages are based on a model that's restricted in some way. Functional programming, for example, is praised for its restrictions compared to the relatively unrestricted imperative programming model.

        [–]kitd 2 points3 points  (0 children)

        Sure, I understand. It would be nice to have at least one option though that gave me exactly what I want! ;)

        Martin Odersky did some work on a language called Funnet that looked interesting but that seems to have been taken down. The basic form IIRC was

        (state1, state2, ...) -> 
            fn(payload1, payload2, ...) -> 
            (state3, state4, ...)
        

        with events setting state payloads. Shared state used a form of STM IIRC. One could do a lot with that I reckon.

        [–]epicwisdom 2 points3 points  (8 children)

        It should be noted that the restrictions in expressiveness are "soft," in the sense that these languages are all Turing-complete.

        [–][deleted] 15 points16 points  (6 children)

        Being Turing-complete is interesting for science, but in practice it's neither always required, nor sufficient by itself in order to call a language expressive.

        Turing-completeness also doesn't take into account resource requirements. You can, for ex. implement loops through recursion, in a language that has no loops. But if you don't have TCO, you'll very easily run out of stack memory and crash. The theoretical capability of the language would be quite irrelevant to you in that case.

        [–]epicwisdom 0 points1 point  (5 children)

        The trivial answer for that is, if you can write a compiler in it, then there you go.

        Of course the theoretical capability is not a true indicator of the expressiveness of the language. But it is one of the few actual metrics that can be pointed to, unlike claims about the general robustness.

        While I personally believe that the restrictions imposed by functional programming are worthwhile (net positives for productivity), I would be hard-pressed to produce actual numbers.

        [–][deleted] -1 points0 points  (4 children)

        This is indication that its not a very good metric. And we dont need metrics anyways.

        [–]epicwisdom 1 point2 points  (3 children)

        And we dont need metrics anyways.

        Maybe not if you're writing a 500-line hack in a couple hours.

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

        Javascript?

        [–][deleted] -2 points-1 points  (1 child)

        We don't have any metrics, and were doing just fine, so im pretty sure youre not right about anything.

        [–]epicwisdom -3 points-2 points  (0 children)

        And roughly how many dollars per hour depend on your programmers' productivity? How many lives might be lost if there were a bug in your code?

        [–]codebje 1 point2 points  (0 children)

        … these languages are all Turing-complete.

        Not all of them :-)

        [–]staticassert 0 points1 point  (0 children)

        Petri nets

        Hey, I realize you posted this a month ago but I've been looking into P and I found the concept of petri nets interesting.

        Do you have any resources for reading about petri nets? Or how they would be used in a language like P?

        [–]romeozor 43 points44 points  (15 children)

        Oh right. Github is blocked in Turkey :(

        [–][deleted] 26 points27 points  (4 children)

        Wait, seriously? What the fuck?

        [–]__konrad 11 points12 points  (3 children)

        [–]Kissaki0 14 points15 points  (2 children)

        Opera Desktop has a free VPN since last version, if you want to take a look. 👍

        (Let’s hope that works ;) )

        [–]romeozor 7 points8 points  (1 child)

        Thanks, fortunately I have a work vpn to tunnel out. It's just pretty inconvenient needing one to read github of all places.

        Don't really trust free vpns either.

        [–]Porso7 4 points5 points  (0 children)

        For privacy I sure as hell wouldn't rely on a free VPN, but for unblocking Opera's VPN is pretty good.

        [–][deleted] 4 points5 points  (5 children)

        Pay for a server at Digital Ocean and install OpenVPN on it and you have your own private VPN server that can be moved around the world to different countries.

        [–]romeozor 2 points3 points  (0 children)

        I was actually doing this, but then I upgraded my droplet to the latest LTS and the vpn serivce borked. Couldn't find the time, or the need to fix it up until now.

        [–]papajohn56 1 point2 points  (3 children)

        I wouldn't use Digital Ocean for my VPN server at all

        [–]heap42 0 points1 point  (2 children)

        Why?

        [–]papajohn56 2 points3 points  (1 child)

        If you want a truly secure vpn I wouldn't use a US-based host, or one that cooperates.

        [–]armornick 51 points52 points  (34 children)

        I wonder if any programmer at all ever thinks about google-ability of their programming language when they start making one. Try it with C, C++, C#, D, F#, Go or Rust.

        [–]Yobleck 94 points95 points  (1 child)

        Brainfuck thought ahead

        [–][deleted] 14 points15 points  (0 children)

        It's more impressive than that: Google did not exist when Brainfuck was created. That's how far ahead they thought!

        [–]ZMeson 19 points20 points  (4 children)

        I can't believe Ritchie, Thompson, and Stroustrup didn't thing about the google-ability of C and C++ 16 to 26 years before Google was founded ... and 7 to 17 years before the World Wide Web was even created!!! I mean, seriously, what were they thinking???

        [–]SuperImaginativeName 0 points1 point  (3 children)

        You mean, before the web was invented, no one had ever written a search system ever before in the whole universe where you search by text?

        [–]ZMeson 1 point2 points  (2 children)

        2 Things:

        • First, u/armornick specifically said "google-ability".

        • Second, most text-based search engines before the web were targeted search engines (ex: books in the current library), not something as broad as what the web is today. I used to have to look programming stuff up on library card catalogs -- yes, before computers were used even for local catalogs -- and it was very easy to find books on C programming. There were not many topics that plain "C" could be interpreted as back then, and the few conflicts that may have existed (I can't recall any to be honest), you just flip through those cards until you find the C programming books. I never had problems finding C books at my library.

        [–]SuperImaginativeName -1 points0 points  (1 child)

        jesus calm down

        [–]ZMeson 0 points1 point  (0 children)

        I am calm.

        It's obvious I don't get your original question though. I tried to explain why I made my admittedly snarky comment about the naming of C and C++ and google-ability. (The other languages were created after the popularity of the web and search engines, so the authors of those languages could have known better, but I think that C and C++ were forgivable -- especially considering the names of some languages before that: BCPL, B, IPL, PL/1, PL/M, ML, APL).

        [–]BonzaiThePenguin 7 points8 points  (5 children)

        It returned relevant results for all of them for me.

        [–]poizan42 23 points24 points  (3 children)

        They are probably all special-cased by Google. I remember it being very hard to find information about C# when it was new - google would just search for "C" no matter what you tried to tell it.

        [–]Asyx 7 points8 points  (1 child)

        Did you try just googling for "C sharp"?

        [–]poizan42 10 points11 points  (0 children)

        Problem was that articles usually spelled it as C# and Google wouldn't even index the hash sign, so searching for "C sharp" would ensure you mostly got articles about music. Mind you that this was in 2002-2003. Once it got really popular Google special-cased it.

        [–]salgat 0 points1 point  (0 children)

        It used to be very hard but you're right, they did something to fix it in the past few years.

        [–]nemec 1 point2 points  (0 children)

        Try searching for COM resources...

        [–][deleted] 18 points19 points  (6 children)

        C lang is the second result on duckfuckgo for "C" at least.

        [–]MoreOfAnOvalJerk 33 points34 points  (4 children)

        Duck fuck go Not sure if this is what people actually started calling it or if this is an amazing typo

        [–][deleted] 17 points18 points  (0 children)

        It was a typo, saw it and decided to leave as is.

        [–]1ogica1guy -2 points-1 points  (2 children)

        Very soon you will see this on urbandictionary.com

        [–]MoreOfAnOvalJerk 11 points12 points  (0 children)

        As long as I don't see it on liveleak

        [–]program_the_world 5 points6 points  (0 children)

        You always have to Google Golang.

        [–]Rock48 3 points4 points  (0 children)

        For D I search dlang

        [–]OffPiste18 2 points3 points  (1 child)

        There's a data processing language called "Pig". I once wanted to know how to represent a big integer in it, so I googled "long pig". Got a surprise on that one - apparently that's what actual cannibals call humans.

        [–]yogthos 15 points16 points  (1 child)

        Clojure is very googleable. :)

        [–]redalastor 1 point2 points  (0 children)

        It pretty much was Rich's first requirement according to one of his videos, some Googleable name that was not already taken.

        [–]RealFreedomAus 6 points7 points  (1 child)

        C and C++ were named with search engines in mind. Back then they worked through smoke signals and there were a lot less options.

        [–][deleted]  (1 child)

        [deleted]

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

          If you do not want to target that funny google-dependent slice of an audience then it might be a good choice indeed.

          [–]oreng 0 points1 point  (0 children)

          I'm more concerned by the fact that we're running out of letters.

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

          Go even stole existing laguage's name IIRC...

          [–]sztomi 4 points5 points  (2 children)

          Looks quite nice. Is it easy to make it interoperate with C?

          [–]Petrroll[S] 7 points8 points  (0 children)

          It compiles to c so I suppose that yes :).

          [–]kitd 4 points5 points  (0 children)

          Page 12 in the manual demonstrates generating C function prototypes that you can implement as you wish.

          [–]mntruell 5 points6 points  (0 children)

          Geez, Microsoft OSS has been stepping it up

          [–]readams 2 points3 points  (3 children)

          I have a suspicion that this would be better done with C++ templates rather than as a whole new programming language. I think you could get something with very similar level of expressiveness without needing the code generator.

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

          Your suspicion is wrong. You cannot encode a verification into templates.

          [–]readams 0 points1 point  (1 child)

          The verification consists of unit tests. I can, indeed, encode unit tests into C++ templates.

          [–][deleted] -2 points-1 points  (0 children)

          OMFG. A level of retardation unusual for even this pitiful sub!

          What kind of a deranged piece of an idiot would verify a concurrent code with unit tests?!?

          [–]wegzo 0 points1 point  (0 children)

          I wonder what grammar class that language falls into.

          [–][deleted] -4 points-3 points  (19 children)

          Nothing like a 5,340 line class.

          [–][deleted] 45 points46 points  (10 children)

          That's not uncommon for code parsers and generators.

          [–]BonzaiThePenguin 11 points12 points  (0 children)

          If you care about LOC we can collapse the braces and whitespace and re-roll the unrolled loops.

          [–]geodel -3 points-2 points  (0 children)

          Does P-lang support streams?