Hacker Newsnew | past | comments | ask | show | jobs | submit | bbkane's commentslogin

Go doesn't monomorphize, so benchmark your generics- they might not be zero cost

Go monomorphizes quite a lot, so that's mostly incorrect - it'd be relatively true for Java, for comparison, ignoring Graal. https://github.com/golang/proposal/blob/master/design/generi... there are only exceptions when you instantiate multiple different types that share an underlying type/layout, all other cases (including different types) are monomorphized. E.g. `type x struct{a int, b float32}` and `type y struct{b int, a float32}` share codegen, but if you even just swap the type order (float32 then int) they wouldn't.

The primitive generic atomics in the stdlib don't run into those details, so you really do get pretty much exactly the compiled code as what you'd write inline by hand:

>In particular, fundamentally different built-in types such as int and float64 are never in the same gcshape. Even int16 and int32 have distinct operations (notably left and right shift), so we don’t put them in the same gcshape.


Are you referring to writing a wrapper cli? Or adding a GUI?

Mostly just a little 1 to 3 line bash script that calls the relevant CLI with the relevant arguments/options for what I want to do. Stuff doesn't have to be complicated.

That sounds like it'll be easier to maintain. Will it also be faster?

It is currently faster than the stock Candle / MPS shaders it replaces on MacOS/ARM64, and IIRC a bit slower than OpenVINO/CPU on my old Windows laptop, where I never got OpenVINO/GPU to compute correctly. Candle didn't have support for GPUs on MacOS/Intel, and OpenVINO ceased to be supported there.

Compared to OpenVINO (I tried ONNX runtime too, but never got it produce correct outputs with my quantized models) it is very nice to be able to build the exact kernels I need, at the quantization settings and precision that works for the models I have and with the custom operators required (speech models do a lot of non-standard stuff), run from a single set of sources, and not have to ship a hefty third-party DLL, and having to deal with their memory leaks and other stability issues.


They should adopt Nushell! It would be seen as very "Apple"- a brave great somewhat non interoperable user experience upgrade

I was a big fan of Nushell for some time but has the same problems as unix shells. I have this CLI tool that manages a lot of things for me (a big one is downloading and cataloging arxiv papers, it downloads them and tags them with metadata and gives each PDF a proper filename based on the author's name and publication year). I tried building this in Nushell but it became eventually so painful.

I'm sorry, what are the same problems you're referring to? I ended up leaving because:

- it was unstable and kept changing (less of an issue now)

- I still need to know bash due to its ubiquity

- it was worse than python for data crunching scripts (ide tooling + my familiarity)

This was several years ago so I'm curious about a more recent perspective


There is some unstability yes.

For me the larger problems were the lack of types which in practice meant that I was running into the same problems as with bash.



Support for custom types is not there.

Oh you mean algebraic types (Elm terminology)? Or the newtype pattern? Or something else?

I'm assuming this was a while back, mind sharing how far he went or what he was able to produce with this focus?

He was planning to go into academia, but ended up abandoning his PhD ABD because he got exposed to the negative interpersonal politics that can happen in academia and realized that was not for him.

So he went to go work a dozen years at a hedge fund and then retire to be a stay at home dad.

His primary research interest was logical frameworks, constructive mathematics, etc. His PhD topic was on using linear logic to verify concurrent programs.


Good for him! That's the dream!

CRDTs are eventually consistent data structures

Interesting, but I'm not sure how it's different from Observable Framework ( https://observablehq.github.io/framework/ ) for dashboards as code. I like that one because it's Markdown and JS instead of a language defined in YAML + templates

The use case that immediately came to mind for me was to use dbt charts as a rendering method for an MCP App.

You don't really want to give a LLM client code execution environment like Observable Framework does. dbt charts appear to validate the entire yaml input including the SQL being sent to the data source.

So I'm getting: a data vis layer that can be dynamically defined and rendered via LLM/MCP client without the headache of sandboxing a JS Runtime environment.


I like the observable framework too - very flexible, you can nail very specific visualization details by dropping down to JS/html.

Maybe this is targeted to pure SQL folks that can get lost in UI details.

PS: one issue that I have with observable framework is authentication and authorization , it requires some system to be built on top of it to handle authn.


Maybe it's because I'm not an RBAC expert, but I had a hard time understanding the data model for folders. Are they a subject? And then there's a layered CASL where layers overwrite each other? And the user is an actor?


Pop a screenshot in your README please!


I just started diagramming with d2- I'll have to try this one out!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: