8 comments

  • mapcars2 minutes ago
    Readable syntax with mandatory indentation is a very questionable idea. For me its easier to understand that something ends with a specific designation, not with a lack of it. Indentation should be solved by formatter and not the language.<p>And I don&#x27;t quite understand the memory model, is it something similar to Rust?
  • xigoi45 minutes ago
    Why is `pure` a keyword that needs to be added, with impure being the default? This discourages programmers from marking functions as pure. I like how Nim does it, with `func` declaring a function (pure) and `proc` declaring a procedure (impure).
    • onlyrealcuzzo19 minutes ago
      I would also recommend this default.<p>We want languages that encourage good design.<p>If your goal is - like Crystal - to be as pain free of a migration from Python to Blorp, this shouldn&#x27;t really impact it, since the compiler can and should be able to auto-fix this.
  • cupofjoakim2 hours ago
    Interesting. there are some parts i like a lot here, but two things that I really dislike syntax wise. One is the lean towards a chainable syntax - this has proven to a big footgun for many devs in both java streams and typescript, making it very easy to go from O(n) to O(2n). The other part i really dislike is the first argument principle noted. If i myself define `string_and_reverse` and I can call it both through `string_and_reverse(42)` and `42.string_and_reverse()` i could definitely see this leading to some very funky looking chaining.<p>Perhaps it&#x27;s just one point from me - not liking chaining :D
    • KolmogorovComp2 hours ago
      &gt; making it very easy to go from O(n) to O(2n)<p>Strictly speaking I assume everyone knows O(n) = O(2n) =O(kn) for k in R.<p>But I see your point. I assume any decent compiler would merge the loops though
      • cupofjoakim1 hour ago
        Fair! That&#x27;d depend on the operations right? For example, AFAIK typescript can&#x27;t do much about multiple chained `map` calls, and i&#x27;ve seen quite a few `.filter(...).map(...).filter(Boolean).map(...)` :&#x2F;
        • c0balt45 minutes ago
          To be fair this likely should be handled by the interpreter&#x2F;compiler for the compiled JS. V8 probably can merge this into one loop or another similar based on runtime types
  • bobajeff1 hour ago
    I know there are people that are used to the indention based scope but that has a real problem when it comes to copy&#x2F;pasting code. I think a alternative that still looks pretty clean is to do like Ruby and Julia and have the function&#x2F;class imply begin and have a literal &#x27;end&#x27;.
    • mohragk8 minutes ago
      Fun fact, in Python, the indentation is checked per block. So, in the outer block, indentation can be 2 spaces, while in the inner block, the indentation is 3 spaces. The only prerequisite is that the indentation in the block is the same.<p>This, to circumvent copy&#x2F;paste issues.
    • xigoi43 minutes ago
      If your editor messes up indentation when copy-pasting, you need a better editor.
  • ramon15659 minutes ago
    I like it. Reminds me of ruby. maybe a more verbose&#x2F;explicit go? cool stuff!
    • onlyrealcuzzo17 minutes ago
      You might like this language I&#x27;ve been working on: <a href="https:&#x2F;&#x2F;GitHub.com&#x2F;Cuzzo&#x2F;clear" rel="nofollow">https:&#x2F;&#x2F;GitHub.com&#x2F;Cuzzo&#x2F;clear</a><p>It&#x27;s not as true to Ruby as Crystal is, because I aim to make it far safer. It&#x27;s closer to Elixir, if anything.<p>But I <i>love</i> Ruby to death, and it is definitely the desire to make it as close to Ruby spiritually as possible.
  • lekevicius52 minutes ago
    Feels like CoffeeScript for C, in the best way
  • voidUpdate2 hours ago
    Is it just me that doesnt like automatically returning the last statement in functions? It makes it hard to see where a function returns, and I dont see how you would do a guard clause at the start of a function without having the entire rest of the function in an else block
    • rtpg2 hours ago
      I remember really bumping up against this learning OCaml in college after having experienced oodles of imperative programming.<p>I understand the sort of philosophy and ergonomics of not having an early return, but it really does hurt certain kinds of code that otherwise would be more readable
    • zdragnar2 hours ago
      I suspect the idea would be to use `match` instead of an imperative `if`. There&#x27;s an example here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kablorp&#x2F;blorp&#x2F;blob&#x2F;main&#x2F;benchmarks&#x2F;blorp&#x2F;sleep_fanout.brp#L8" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kablorp&#x2F;blorp&#x2F;blob&#x2F;main&#x2F;benchmarks&#x2F;blorp&#x2F;...</a><p>Then again, there&#x27;s really not too many examples of early return guards, but I did manage to find one where the body is stuffed in an `else`:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kablorp&#x2F;blorp&#x2F;blob&#x2F;main&#x2F;benchmarks&#x2F;blorp&#x2F;binary_trees.brp#L16" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kablorp&#x2F;blorp&#x2F;blob&#x2F;main&#x2F;benchmarks&#x2F;blorp&#x2F;...</a><p>It does make me think that the usual types of guards might typically happen higher up (handled by the caller) or hidden with safe &#x2F; monadic type operators that simply pass through rather than bailing out, so to speak.
    • bjoli2 hours ago
      I think it is much more obvious than being able to return from anywhere in a function. If the last expression is a match, I know every match body must return the same type. if the last is a (cond ...) I know ever cond branch must return a value. I vastly prefer that.
    • troupo1 hour ago
      If it&#x27;s inconsistently applied, yes.<p>In most functional languages however you can view the end of any statement&#x2F;expression as a return&#x2F;assign which makes it very easy and trivial to assign anything to variables, or split anything into function calls.
  • NuclearPM1 hour ago
    [dead]