Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)CO
Posts
2
Comments
90
Joined
2 yr. ago

  • You're literally posting from the SDF's instance. If you're not going to support FLOSS, then consider migrating to a server which reflects your beliefs. (Also, go take an anthropology course so that you don't embarrass yourself by dehumanizing people online.)

  • Mattermost is the most obvious option; it's a clone of Slack. IRC is another good option, although I know a lot of people hate it because they prefer features to freedom. I cannot recommend Matrix; the UX is fine but the cryptography has a few issues, as documented by Soatok here.

  • And for anybody thinking of implementing M-expressions, look at Wolfram Mathematica, which is the only popular M-expression-oriented language. It turns out that high-level graph-rewriting semantics are difficult to make efficient! (If you want to try, you might also want to look at GHC or other efficient graph-rewriters to see what the state of the art is like outside Planet Wolfram.)

  • Well put. And this is a generic pattern; for example, GPUs are only faster than CPUs if the cost of preparing the GPU and retrieving the result is faster than directly evaluating the algorithm on the CPU. This also applies to main memory! Anything outside of the CPU can incur a latency/throughput/scaling tradeoff.

  • python3Packages.scikit-image appears to be available and non-broken in nixpkgs; on my machine, I get /nix/store/w8681ncsw92cn4gq6gyraw4z19r0r6c3-python3.11-scikit-image-0.21.0. Do you have an actual example?

    I understand your point, but given nixpkgs' position in the community, it might be a moot point.

  • There are subfields of computer science dedicated to this question. A good starting point for the theory would be Pessimal algorithms and simplexity analysis, which lays out two concepts:

    • The time & space simplexity of an algorithm indicates best-case lower bounds on resource usage, and
    • An algorithm is pessimal if no equivalent algorithm wastes more time/space/etc.

    For example, common folklore is that sorting has O(n lg n) time complexity, depending on assumptions. In the paper, they give that sorting has Ω(n ** (lg n / 2)) time simplexity; any algorithm which takes more time, like bogosort, must do so through some sort of trickery like non-determinism or wasting time via do-nothing operations.

  • It looks alright. You'll have to use it for a few months before knowing whether it's comfortable.

    To be honest, I'm not a fan of variables; I'm in the tacit/concatenative camp. But I think it's good to try new things and learn for yourself why they are good or bad.

  • Your code looked alright. Working in C is a risky chore. You're early in your journey and I think it's good to get a taste of many of the traditional techniques before turning towards newer fancier algorithms.

    "Haskell and OCaml", hm? The two concepts you need to internalize are katamorphisms and paramorphisms. You may have heard of "recursion schemes"; these two schemes are the ones available on any tree. Fundamentally, most of a compiler is tree-to-tree transformations (nanopasses), and they are expressible as one of two forms:

    • Katamorphism: The leaves of each node are transformed before the branch (bottom-up)
    • Paramorphism: The leaves are transformed after/during the branch transformation (top-down)

    If you look again at my AST builder builder, you'll see .run() and .walk() methods, implementing the recursion for any katamorphism or paramorphism respectively. In Haskell, these are called Traversable types. This is a pun in Monte, where .run() is also the default method; the syntax makes it easy to perform a katamorphism by passing a tree-traversing object directly to the AST.

    Your types are alright, but you'll want to pass a generic parameter through them, turning them into a valid Functor in Haskell or a generic module in OCaml. This is a basic defense against the "AST Decoration Problem", AKA the "AST Typing Problem". As you add features to your compiler, you'll realize why these are necessary.

  • Congratulations on taking a step towards self-hosting and meta-circular compilation. ASDL is a great intermediate meta-language and it can be used to abstract any sort of Builder or Command workflow. This is sometimes called a "narrow waist"; ASDL replaces ad-hoc AST-builder objects with a unified protocol and interface.

    For example, I encoded Monte into ASDL while rewriting the compiler in Monte, as part of a self-hosting effort. I also wrote a module which parses ASDL and emits Monte modules, including AST-building tools at runtime. Monte supports E-style quasiliterals, including source-code literals. This let our compiler directly consume ASDL files and emit Monte source code. Going beyond the compiler, this allowed me to encode UI elements and widgets as ASTs and use the Command pattern to write widget-handling objects.

  • The definition of recursive language can be read on Wikipedia too. Quoting from that page:

    All regular, context-free and context-sensitive languages are recursive.

    But not all recursive languages are regular. As for "recursive", it's a historical term that might not be sufficiently descriptive; today, I'd usually call such languages decidable, to emphasize that they are languages which we can write (always-halting) computer programs to detect.

  • Microsoft is no longer able to outcompete the Free Software commons. That's all.

    You might want to re-read the thread and think about how you sound, by the way. You're coming off as a concern troll, not as a member of the Free Software community.

  • I copied and pasted from the terminal to ensure that I formatted the error message properly. The question-mark prompt is what E used, or at least E-on-Java. Monte used a little Unicode mountain:

     
            ⛰  currentProcess.getProcessID() :Int
        Result: 2805098
        ⛰  def x :Int := "42"
        Exception: "42" does not conform to Int
        ⛰  "42" :Int
        Exception: "42" does not conform to Int
    
    
      

    I can't really give a reason other than that the prompt characters on Unix-like systems are arbitrary and most REPL libraries allow them to be customized.

  • [HTML and Markdown] are not grammatically Type 2 (Chomsky-wise, Context-Free); rather, they are Type 3 (Chomsky-wise, Regular).

    This is at least half-wrong, in that HTML is clearly not regular. The proof is simple: HTML structurally embeds a language of balanced parentheses (a Dyck language), and such languages are context-free and not regular. I don't know Markdown well and there are several flavors; it's quite possible that some flavors are regular. However, traditional Markdown embeds HTML, so if HTML is not regular than neither is Markdown.

    I once did a syntax-directed translation of Markdown to HTML in AWK!

    Sure. The original Markdown implementation was in Perl and operated similarly. However, note that this doesn't imply that either language is regular, only that a translation is possible assuming the input is valid Markdown. Punting on recognition means that invalid parse trees have undefined translations, presumably at least sometimes generating invalid HTML.

  • If it's on Stack Exchange, you can help us keep the community decent by assuming good faith and being patient with newcomers. Yes, it's frustrating. And yeah, sometimes, it's basically impossible to avoid sarcasm and scorn, just like how HN sometimes needs to be sneered at, but we can still strive for a maximum of civility.

    If all else fails, just remember: you're not on Philosophy SE or any of the religious communities, it's just a computer question, and it can be answered without devolving into an opinion war. Pat yourself on the back for being a "schmott guy!" and write a polite answer that hopefully the newbies will grok. Be respectful of plural perspectives; it's a feature that a question may have multiple well-liked answers.