1. 19
  1.  

  2. 2

    I took part in the Langjam and had many similar ideas to hoppecl who took them much further than I did during the same amount of time. Not only that but PlsExplain has better design, coherence, execution and explanation.

    I think the readme is worth reading as a post, even if you never run it.

    There’s even error handling and clean debugging messages. I’m always amazed when people can do this in jam whereas I mostly end up with a pile of hacks. In the same vein, I see a lot of projects, including this one, with tons of examples and I don’t know how people get to do that on top of making the language and working with it, presumbly while it is quite unstable.

    The autogenerated comment works surprisingly well IMO. Even if the Fibonnacci example that was too long, you can see the execution arriving at the result.

    1. 1

      The first question that comes up is “is it useful?”. If the example comments all just stating what the value is, it looks really bad.

      (I’m not saying it’s not useful, just that I expect at least one useful example or a motivation why this might be useful)

      1. 2

        I agree that the examples provided aren’t particularly compelling but I think it is useful. I think the value comes from comment concatenation which allows you to generate a history of the origin of that value. It is sort of like a stack trace of values.

        A more motivating example to me is an error that occurs while parsing a file. You would want to include the file name in the error message. This can be easy if your parse-file function calls parse but if you want to to use the same code path path for files, commandline strings or network requests you may first read the file to a string then pass it into parse. If this string had the comment “contents of example.json” the error message is automatically very helpful.

        The downside is how do you decide what is important. And some common patterns would produce massive unhelpful comments. (For example an immutable data structure would contain every mutation after a while, but I guess you would update these to not change the comment on mutation.) It may be better to treat and format these as a “value backtrace” which would be easier to digest a lot of context.

        1. 2

          You pretty much wrote my thought on this, that it serves as a value trace. And there are definitely cases where I would have like to have something like that to know how a complex object came about.

          The downside is how do you decide what is important. And some common patterns would produce massive unhelpful comments.

          I think instead of a string, it could be a tree with the value trace and you could control the depth of how much you want to print.

          1. 1

            I agree. This is what I meant by treating the values as a trace. Forget about the resulting string and focus on properly tracing the value then it can be formatted and explored properly.

        2. 2

          I believe it’s a language created specifically for Langjam so it’s probably more of an esolang for learning purposes

          1. 1

            In that case, I can totally understand that they didn’t go into every detail in the readme.