~akavel


#65 Borrow checker design 3 months ago

on ~icefox/garnet

I did see it, but this reminded me to look at it again. Thanks, it's very promising. Doesn't get too deep but it says there will be a follow-up, so I look forward to it.

On March 5, 2024 9:39:40 AM EST, ~akavel outgoing@sr.ht wrote:

Not sure if you've seen it, but IIUC the new post from Niko Matsakis may be of interest here: https://smallcultfollowing.com/babysteps/blog/2024/03/04/borrow-checking-without-lifetimes/ (or not? the contents definitely flies over my head; but I just immediately thought it could possibly be interesting to you in context of Garnet)

#65 Borrow checker design 3 months ago

Comment by ~akavel on ~icefox/garnet

Not sure if you've seen it, but IIUC the new post from Niko Matsakis may be of interest here: https://smallcultfollowing.com/babysteps/blog/2024/03/04/borrow-checking-without-lifetimes/ (or not? the contents definitely flies over my head; but I just immediately thought it could possibly be interesting to you in context of Garnet)

#52 Packages and namespaces and stuff 5 months ago

Comment by ~akavel on ~icefox/garnet

The only things I've seen in production that are similar to this in concept are C/C++ .h files, which are such a terrible hassle they're a great warning of what not to do (...)

IMO they're a hassle because you need to freaking write and maintain them by hand. OCaml's .mli files were always suspicious to me for the same reason - though I didn't go further than hello-world in OCaml. I would assume at the time C was invented (not sure about OCaml, seems cvs already existed, but maybe was not yet popular enough?), there was no good tooling around versioning, so letting compiler auto-modify something so important as an "api file" could be seen as too risky; also at the time of early C, several hours of highly-educated human labor were probably still way cheaper than a bunch of CPU cycles. I remember what a revolutionary idea the wiki was, how long it took me to grasp and internalize that letting people from around the world "break a website" is totally fine when there are diffs and history. Personally, storing and versioning an auto-generated .api file sounds super cool to me! that would be an awesome item to scrutinize over, Go taught me the value of good APIs. And yet it doesn't have to be mandatory for people - those who don't want to scrutinize them could add them to .gitignore instead. There could be an option to either generate them into source directories for those who appreciate this, or into a non-versioned build artifacts directory for those who don't.

#53 Syntax bikeshed 7 months ago

Comment by ~akavel on ~icefox/garnet

Re: api/loc: FWIW IIUC in Go, the loc kinda got called internal. This sounds reasonable to me, in that it marks an entity as "internal to the module/package/library/crate/whatever".

#44 Blocks as shortcuts for anonymous methods? 7 months ago

Comment by ~akavel on ~icefox/garnet

#43 Capability based stdlib 7 months ago

Comment by ~akavel on ~icefox/garnet

Regarding logging: I think I recall reading somewhere that in languages with explicit tracking of capabilities, some functions could still explicitly state that they implicitly pull some capability from the environment? though not sure how to then make it not part of function signature...

Or maybe some functions (logging/debugging) could be marked as globally exempt from capabilities tracking? (though, this then also reminds me of the log4j incident...)

#19 Figure out (basic) errors/panics 7 months ago

Comment by ~akavel on ~icefox/garnet

Isn't it expected that the OS will clean up any handles after a crashed application?

Also: https://lwn.net/Articles/191059/ ("Crash-only software...")

As to Zig's errors, they have one long-standing unresolved ticket that for now is mostly being kept swept under the rug: https://github.com/ziglang/zig/issues/2647 (see e.g.: https://github.com/ziglang/zig/issues/2647#issuecomment-1444790576)

And now it also reminds me that Araq (Nim creator) has some blogpost musings about error handling: https://nim-lang.org/araq/quirky_exceptions.html

#46 Try to figure out how to unfuck module terminology 7 months ago

Comment by ~akavel on ~icefox/garnet

Brainstorming: a "stencil"? a "meta-package"? a "type-package"? I briefly tried to learn OCaml some years ago, so I only vaguely started understending the difference vs. modules as "commonly understood" outside MLs. Could you try describing how you understand what a "ML module" is/represents? Sometimes dwelling on that, and then grabbing thesaurus.com, can help come up with some platypus-like but still somewhat evocative name. (Also, all names were initially weird and unfamiliar when invented, until they became familiar and "obvious" through repeated use.)

#19 Feature: Bit operations 7 months ago

Comment by ~akavel on ~icefox/garnetc

WARNING, WARNING, two potentially derailing tangents approaching!

  1. If garnet aims to have (and already has?) UFCS and generics, doesn't that already become somewhat more manageable even in function form? e.g.: oldstate :__rshift(18) :__bxor(oldstate) :__rshift(27) :__to_i32()? Isn't this one of the big appeals/selling-points of UFCS?
  2. I've seen people start to complain that there are many more "mathy planes" where expressions also become "vivid", e.g. matrix arithmetics - thus arguing for operator overloading. (Interestingly to me, I feel that both Nim and OCaml seem to have somehow allowed operator overloading yet still managed to keep it in sane area, maybe through culture - as opposed IMO to Haskell in one troublesome corner, and C++ in another troublesome corner.)

#28 Sometimes we can't know the types of numbers 7 months ago

Comment by ~akavel on ~icefox/garnetc

IIRC, in Go consts are considered "infinite"/arbitrary precision until required to be "down"-cast to some concrete precision. And const expressions operating on consts are IIRC by default also operating on those infinite/arbitrary precision consts (i.e. the compiler uses BigInt under the hood in those cases, I believe). Not sure if that applies to all cases that you meant here, but just sayin'.

See e.g.: https://go.dev/blog/constants and https://go.dev/ref/spec#Constants