Better HN
topnewbestaskshowjobs
Log inSign up

hyperbrainer

805 karma · joined Jun 19, 2023 (3y ago) · 214 submissions

Submissions

31.

Lens: Lenses, Folds and Traversals(hackage.haskell.org ↗)

88 points · by hyperbrainer · 1y ago · 60 comments

comment 1y ago · link · parent

I wonder whether CV models could help speed this up. There is the obvious challenge of pieces not fitting together exactly, being broken or otherwise defaced etc. but then humans are struggling with the same thing, just that computers have far better memories.

33.

All color is best effort(fasterthanli.me ↗)

3 points · by hyperbrainer · 1y ago · discuss

comment 1y ago · link · parent

The water also serves the purpose of reducing reflecting acoustic energy.

35.

The Hashtable Packing Problem (2020)(backscattering.de ↗)

39 points · by hyperbrainer · 1y ago · 15 comments

comment 1y ago · link · parent

Related: https://github.com/ocaml/RFCs/blob/881b220adc1f358ab15f7743d...

comment 1y ago · link · parent

To be clear, this is not my review. I just found it very interesting and relevant to my own work.

38.

A Rust Documentation Ecosystem Review(harudagondi.space ↗)

94 points · by hyperbrainer · 1y ago · 14 comments

39.

Why GADTs matter for performance (2015)(blog.janestreet.com ↗)

83 points · by hyperbrainer · 1y ago · 26 comments

comment 1y ago · link · parent

Most table tennis players don't play at the level of the World Cup.

41.

Custom Logging in Rust Using tracing and tracing-subscriber(burgers.io ↗)

2 points · by hyperbrainer · 1y ago · discuss

42.

I started an open source project in 2004. This week, it hit 30000 GitHub stars(medium.com ↗)

11 points · by hyperbrainer · 1y ago · discuss

comment 1y ago · link · parent

If you wish to approach Category Theory from the viewpoint of a programmer, not a mathematician, I suggest Bartosz Milewski's book Category Theory for Programmers. For this, all you need is some previous programming experience. He uses C++ and Haskell iirc but as long as you can read snippets of code, you'll be fine.

I am suggesting this since you said you want to better understand functional programming. Category Theory, as mathematicians look at it, is an extremely abstract field. If you want to do pure math related stuff in Category Theory, and only then, I would say important prereqs are Abstract Algebra and Topology. I believe the motivation for Category theory lies in Algebraic Geometry and Algebraic Topology, but you definitely don't need to be an expert on these to learn it.

comment 1y ago · link · parent

Wow, thank you so much for taking the time to do this. I love all of you guys in the rust community.

> Would https://docs.rs/tracing-subscriber/0.3.19/tracing_subscriber... help you?

Indeed. This is brilliant.

comment 1y ago · link · parent

Okay this is really funny because I was messing about with generics relating to the Write trait just yesterday, leading to much frustration.

> you find yourself propagating a generic bound up an entire hierarchy of data structures and functions using those structures

And I did exactly that. I did eventually get around to using dyn Write, but that still gave me headaches because of how I cannot use impl Write as a result type in closures, which I need to do if I want to use tracing_subscriber::fmt::with_writer() and pass in these trait objects.

Despite being this close to the solution, I somehow again wound up propagating generics back at least four functions.

I ended up not writing any generic-based stuff and resigned to just manually writing each type's implementation out, but I am going to tinker with this again today. Hopefully, I can use your advice.

Thank you so much for taking the time to write this. Means a lot!

> there was something satisfying about C in the old DOS days, where you could make a pointer to video memory and scribble on it

Exactly.

comment 1y ago · link · parent

It's hard to pinpoint the problem, because I love and adore Rust. So, thank you for all the work you have put in -- it's a great language.

I feel like my biggest struggle is simply how hard (tedious?) it is to properly work with generics and some more complex applications of traits. Any time I am working with (especially writing, somehow reading is easier) these, I always take an ungodly amount of time to do anything productive.

I am almost certainly sure this is a skill issue -- I am simply not "Rusting" like I am supposed to. Maybe I overuse generics, maybe I rely on traits too much, maybe I am trying to abstract stuff away too much. But this is one of the reasons I want to also explore other languages in the space, especially ones which make it impossible for me to make this so complex.

Don't get me wrong -- all of this complexity is a joy to work with when I can use my brain. But sometimes, it's just too much effort to do stuff, and it feels like I could be getting away with less. Curiously, I never had a problem with the borrow checker, even though people often complaining about how much it forces them to "stop and think".

Another thing is that C, for some weird reason, always feels "lower level" than Rust, and seeing it gives me some sort of weird satisfaction that Rust does not. Maybe it's just a greener grass syndrome, but wanted to mention it nonetheless.

All this said, I want to just emphasise, that despite this shortcoming (if it even is one), if I were forced to choose a language to spend the rest of my life with, I would not be the least bit sad to only ever use Rust again. I absolutely love it.

comment 1y ago · link · parent

Unfortunately, it seems to use a GC for the safety, which makes it unsuitable for a variety of tasks in the systems programming domain. Seems to me like an alternative to Go more than Rust or C or Zig

comment 1y ago · link · parent

I think the problem is that some of the more advanced things related to generics or traits are half-baked or maybe somewhat function only in unstable, leading to horribly written code, or code which takes far more complexity to run than it should.

comment 1y ago · link · parent

The full language is indeed even further ahead of Rust on the spectrum I am looking at, but this seems like a cool effort. I love proof-based languages and dependent types, so this is an absolute win.

What intrigues me quite a bit relative to the main topic of the HN thread is Low[0]

> Low

is not only a language subset, but also a set of F* libraries that model a curated set of C features: the C memory model, stack- and heap-allocated arrays, machine integers, C string literals, and a few system-level functions from the C standard library. Writing in Low, the programmer enjoys the full power of F for proofs and specifications. At compile-time, proofs are erased, leaving only the low-level code to be compiled to C. In short: the code is low-level, but the verification is not.

[0] https://fstarlang.github.io/lowstar/html/Introduction.html#t...

comment 1y ago · link · parent

V looks exactly like one of the languages I was talking about. Some controversy about the project, it seems like, but very cool nonetheless. Even if it doesn't actually work like described, the description seems quite interesting.

> But I've had a few issues with the safety aspects of the language. Breaking through the checker isn't that difficult.

What do you mean? Can you "break through the checker" outside of unsafe blocks?

comment 1y ago · link · parent

I love Rust, and will continue to use it. But sometimes it feels like "too much". If you have programmed in Rust, you know what I mean. I want to use and experience a language that is to Rust almost like what C is to C++.

This is primarily an educational exercise to see how people find compromises that work for them, and languages in the same space as Rust using alternative strategies.

comment 1y ago · link · parent

I don't mind the language having substantially worse "something" as long as it can be a smaller alternative for Rust, for the lack of a better word. Of course, there always needs to be some compromise. I don't mind that. I just have two requirements, and am curious to see how people have tackled that problem.

53.

Ask HN: Memory-safe low level languages?

61 points · by hyperbrainer · 1y ago · 117 comments

comment 1y ago · link · parent

Not a technical difference, but I think Mercury is somewhat more "commerical" in that it's out of development and can be used in real projects, compared to Curry, which is very much in development.

55.

Curry: A functional logic programming language(curry-lang.org ↗)

172 points · by hyperbrainer · 1y ago · 37 comments

56.

The Busy Beaver Frontier [pdf](scottaaronson.com ↗)

4 points · by hyperbrainer · 1y ago · discuss

comment 1y ago · link · parent

Which is despite, a decade of attempts, still missing dependent types. Time to embrace Idris.

Or embrace logic + functional programming: Curry. https://curry-language.org/

comment 1y ago · link · parent

Austral's specification is one of the most beautiful and well-written pieces of documentation I have ever found. It's section on error handling in Austral[0] cover everything from rationale and alternatives to concrete examples of how exceptions should be handled in conjunction with linear types.

https://austral-lang.org/spec/spec.html#rationale-errors

comment 1y ago · link · parent

I was quite impressed with Austral[0], which used Linear Types and avoids the whole Rust-like implementation in favour of a more easily understandable system, albeit slightly more verbose.

[0]https://borretti.me/article/introducing-austral

60.

Monsky's Theorem(mathmondays.com ↗)

49 points · by hyperbrainer · 1y ago · 13 comments

12345
8