~akavel


#64 Pattern matching 15 days ago

Comment by ~akavel on ~icefox/garnet

The above is a bit too much to me at this time, but just a few questions from trying to skim it, sorry if dumb or misguided:

  1. uh, so if and match would be separate things? I thought the point of this syntax was to unify them, no?

  2. could it be possible to special-case the one-liner, and the two-liner if-else, to allow skipping the pipe character on the first line just in those two cases? e.g. "if pipe-character is not found, it is assumed to be immediately after the if"; i.e. allowing all of the following:

     if cond1 -> expr1 end      -- this and below equivalent to: if | cond1 -> expr1 end
    
     if cond1 ->
         expr1
     end
    
     if cond1 -> expr1          -- again, this line equiv. to: if | cond1 -> expr1
     else cond2 -> expr2
     end
    
     if cond1 ->
         expr1
     else
         expr2
     end
    

edit: one more loose idea - to make if be syntax sugar for match | ?

#53 Syntax bikeshed 26 days ago

Comment by ~akavel on ~icefox/garnet

I don't know if you do, but I didn't know about Pallene before (via, and):

The Lua authors (edit: apparently, it's their students: "We collaborate with Roberto over some Pallene-related research, specially about the type system semantics, but he isn't an active committer.") have been working on the new companion language to Lua named Pallene. Pallene is a subset of Lua that adds types, not for the sake of types themselves, but for the purpose of performance. The Pallene compiler can generate optimized native code that potentially removes the need to manually write a module for Lua in C. (...)

Docs https://github.com/pallene-lang/pallene/blob/master/doc/manual.md

Looks similar to Teal.

#64 Pattern matching 27 days ago

Comment by ~akavel on ~icefox/garnet

I'm happy that you saw and linked the lobste.rs discussion, as I immediately thought of you when I saw it, seems to be quite a lot of interesting ponderings from a bunch of people.

Personally, I'm also kinda on the fence with this syntax. On one hand, the author seems to claim it simplifies a lot of things, which I take on trust as I also didn't have patience to comprehensively analyze and think through all the examples they provided. Which sounds like a good thing! And like they know what they're doing. On the other hand - it's hard to describe, but "on feeling", for now I seem to find the syntax a bit clunky; like not "flowing" super smoothly. Maybe that's exactly about the "if | x > 0" part, I'm not sure. But on the other hand, isn't New Syntax Idea Always Feeling Clunky Initially Until You Get Used To It And It Becomes Natural And The Best Thing Since Sliced Breadβ„’? So, I think I feel similarly being torn.

With all the above, one thing that I was certainly immediately wary of in some of the examples shown, is a fear of rightwards-drift - personally I'm super spoiled in this area by Go, I'm now just so frustrated with languages where it happens. Including Rust for a while, but fortunately let-else was finally, finally stabilized; and also keeping my fingers crossed for if-let-chains. So, yes, please, please don't put indent in switch/match/... whatsit cases first rows...

Plus also, maybe one thing I'm realizing feels somewhat weird with the propozed new syntax, is having a sole if word sticking out in the first row of the block. Kinda feels wasted, maybe like a typographic orphan (or whatever's the name). But again, it's just a small thing; more saying it to try and capture and throw out of the system what makes me somewhat uncomfortable, in hopes of putting it in light and seeing if it will wither and die.

#7 Thoughts on matches/tree-walking (and data in general) a month ago

Comment by ~akavel on ~icefox/garnet

https://lobste.rs/s/ctopbt/programming_languages_should_have_tree and https://news.ycombinator.com/item?id=43831628 - or, some internet guy arguing some stuff about tree traversal and ensuing hackernews as well as lobsters arguing as well.

#16 Create rationale document a month ago

Comment by ~akavel on ~icefox/garnet

https://lobste.rs/s/6lrfje/designing_type_inference_for_high - "something something type inference and helpful compilation error messages" - again some article that flies way over my head, but made me think of garnet and that I'm not sure if you seen it or not, so I let myself dump it somewhere here. Also not sure in which thread again, sorry.

#53 Syntax bikeshed 4 months ago

Comment by ~akavel on ~icefox/garnet

Not sure where to best write it - sorry if that's not the right thread and maybe some other is better - not a problem for me to delete from here and move elsewhere (assuming sr.ht allows for deleting posts?)

So, just wanted to say, as far as possible inspiration/related lanugages go, I just discovered that the Teal language (formely "typed Lua") had a new major release recently, with some new features that might (or might not) be of some interest to you - in case you also missed it, the link is: https://github.com/teal-language/tl/blob/v0.24.4/CHANGELOG.md#0240---teal-spring-24

#47 ABI thoughts 7 months ago

Comment by ~akavel on ~icefox/garnet

I distinctly remember recently stumbling upon some page (or reddit comment?) elaborating on why ABI stability in C++ is not a good thing (AFAIR, one of the things listed was that they can't upgrade the data structures used in stdlib containers, e.g. hash map). Possibly in context of some question like "why Rust no haz stable ABI???". But I seem unable to find it in any of my half-broken bookmarking systems, so, sorry :( anyway, just wanted to put it here for completeness, not that I want to sway the decision in any direction. But again, anyway, can't find at the point, so, uh... :( πŸ€·β€β™‚οΈ

#16 Create rationale document 7 months ago

Comment by ~akavel on ~icefox/garnet

An interesting "high-level" discussion about Rust and C++ with Steve Klabnik and Herb Sutter, including some "what if we had a time machine" pondering as well:

https://softwareengineeringdaily.com/2024/10/23/rust-vs-c-with-steve-klabnik-herb-sutter/ (via)

a transcript (with some small issues): http://softwareengineeringdaily.com/wp-content/uploads/2024/10/SED1756-Rust-vs-Cpp.txt (via)

#64 Pattern matching 8 months ago

Comment by ~akavel on ~icefox/garnet

FTR - regarding the paper, one point that is easy to overlook when skimming, is the proposed syntax for languages not using "significant whitespace" for blocks (pg. 6):

if x { > 0 then "positive"; == 0 then "null"; else "?" }

#72 Crazy enum-struct hybrids 8 months ago

Comment by ~akavel on ~icefox/garnet

I dunno that I actually want to do something like that in Garnet --Rust does a very good job of making questionable things a bit inconvenient to write so that you have some time to think about how much you really need them-- but I appreciate how slick it is.

I think the point and argument of Garnet is in part that Rust makes some things a bit too much inconvenient, no? 😜 I always liked the phrase, sometimes used for various technologies, that: "it feels like there's a smaller, simpler [language] hiding inside [Rust] and wanting to escape" - I'm kind of assuming that's what drives you forward, and it's at least what I'm hoping for Garnet to try to be 😜

That said, I did also eventually kinda grow some understanding at least of why Rust, as it is currently, does some things the way it does; I put my attempt at explaining my thoughts on that into another diagram 😜

But with the above apology towards Rust, I still can't stop feeling annoyed by it 😝 so still hoping that indeed things can be simplified in some "second system/generation" language based on lessons learnt by Rust 🀩 And keeping my fingers crossed for Garnet for that 😜🀞

But, in the end, whether to support some particular pattern in Garnet or not, is obviously your call and privilege to make πŸ˜ƒ