Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lock1
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
31.
▲
by
lock1
11mo ago
Probably, the problem with Java's `try-catch` is it's not composable and has an abundance of unchecked exceptions (could mess up `catch` type). In Rust, you could just `?` to short-circuit return or do another chained method call
32.
▲
by
lock1
11mo ago
IMO, both ternary operator form & Rust/Haskell/Zig syntax works pretty well. Both if expression syntax can be easily composed and read left-to-right, unlike Python's `<true-branch> if <cond> else <false-bra
33.
▲
by
lock1
11mo ago
In the end, it's still just a text editor. Don't expect that you will get things done n times faster than in vscode without extra effort added. > I'm a VSCode user and when I hear people talk about neovim and it custom
34.
▲
by
lock1
1y ago
Can't see "File system design philosophy" within the article. It's more like, "oh, it turns out simplified models are not enough to describe real engineering problems!" written by LLM and posted on Medium.
35.
▲
by
lock1
1y ago
For me, I find reviewing and analyzing programming languages to be a fun activity. Writing esolangs is also fun, you can write it without needing to care about things like backward compatibility or practicality. This reminds me of recreatio
36.
▲
by
lock1
1y ago
> Of course, in both languages you can write unidiomatically, but that is a great way to ensure that bugs get in and never get out. Why does "unidiomatic" have to imply "buggy" code? You're basically sayi
37.
▲
by
lock1
1y ago
Why does "good" C have to be zero alloc? Why should "nice" javaesque make little sense in C? Why do you implicitly assume performance is "efficient problem solving"? Not sure why many people seem fixated on the
38.
▲
by
lock1
1y ago
Yeah, I think it's way too expensive if you're not using USD. It's +70% more than the price of the current Factorio steam price in my local currency. And with 40$ for the steam release, it has to be higher than Factorio post-
39.
▲
by
lock1
1y ago
Hidden indirection & runtime magic almost always refer to DI frameworks. Reflection is what makes DI feel like "magic". Type signatures don't mean much in reflection-heavy codes. Newcomers won't know many DI framewor
40.
▲
by
lock1
1y ago
Like other sibling replies said, subranges (or more generally "Refinement types") are more about compile-time guarantees. Your example provides a good example of a potential footgun: a post-validation operation might unknowingly v
41.
▲
by
lock1
1y ago
If you want to practice, try: https://littleosbook.github.io/ I am an occasional uni TA that teaches OS and I use littleosbook as the main reference for my own project guidebook. It's a decent warm-up project for under
42.
▲
by
lock1
1y ago
So, another `Option<T>`-like? I'm not sure I'm following with the article, I don't think there's much of a problem treating `java.util.Optional` as a `Maybe`-like. Regardless of "monad" label, it does wor
43.
▲
by
lock1
1y ago
> But now string literals are “untrusted”. So you have to do new String(“this is trusted content”) everywhere you need it, which is a pain. Eh? Isn't that the main point of doing all of this? Being explicit on the boundaries
44.
▲
by
lock1
1y ago
Sure, I guess that's worth mentioning in the context of the original post. It's true that Java implementation of parametric polymorphism has a performance drawback compared to Rust or C++. And it's certainly a bad idea to use
45.
▲
by
lock1
1y ago
Visibility modifier as a native language feature is not the easy part. It's more like "comptime safety feeling" => "language w/ visibility modifier" but the converse is not necessarily true. Without language
46.
▲
by
lock1
1y ago
Why is that not feasible? You could define `Untrusted<T>` container and `.map()` in Java just fine.
47.
▲
by
lock1
1y ago
Interesting. Though it reminds me of Alexis's "Parse, don't validate", isn't `syscall :: u8 -> Untrusted<u8>` considered as "validate"? I hope kernel codes that consume it will transform it to app
48.
▲
by
lock1
1y ago
And OOP is just subtyping and visibility modifiers too! /j The main problem with ADT is language support for them. Primarily sum types, as they're missing in a lot of major PLs, while product types are "just" structs or
49.
▲
by
lock1
1y ago
No? I think you're confusing ADT with a Typescript-like type system. Adding language support for ADT is not really a warrant for an "enough DOF to become scary" sticker. I find modern Java surprisingly pretty good at capturin
50.
▲
by
lock1
1y ago
As other sibling comments have said, it's cultural. Fortunately, there's some push toward functional & ADT-style modelling in the Java community and they've decided to call it "data-oriented programming" for som
51.
▲
by
lock1
1y ago
As an occasional uni TA, I'm leaning toward banning LLM for easy coursework while allowing it on more difficult & open-ended ones. Pretty sure it's a self-destructive move for a CS or software engineering student to pass found
52.
▲
by
lock1
1y ago
Yeah, it's quite sad, considering it's already built-in on all major browsers. And it's not even hard to open it, like a click away on devtools tab. But I think promoting profilers is much more important than debuggers. Far t
53.
▲
by
lock1
1y ago
Search for "watchpoint debugging". Usually in most garbage-collected environments, it just observes & breaks on symbols though, not raw addresses. Vscode (or an editor with ADP support) supports unconditional breakpoints, watc
54.
▲
by
lock1
1y ago
So, uh, everything is important, and every engineer must know everything then? I mean, don't get me wrong, I do agree engineers should at least be aware of the existence of debuggers & profilers and what problems they can solve. It
55.
▲
by
lock1
1y ago
Can't wait for (((LLM) Hallucination Risk Calculator) Risk Calculator) Risk Calculator to propagate & magnify the error even further! /j
56.
▲
by
lock1
1y ago
IMO, while Genichiro and sword/spear-wielding enemies are mostly fun, non-humanoid & gank bosses suck so bad. Those bosses felt way too frustrating to me because they force you to unlearn the entire deflect gameplay, turning it int
57.
▲
by
lock1
1y ago
> I do not understand your argument about branches, how would it hinder the jump instructions? Extra set of logic for handling NaN cases? I don't think it's impossible, just kind of less intuitive. Jump instruction usin
58.
▲
by
lock1
1y ago
Wouldn't this make CPU flags useless? I think it would complicate branch instructions too, as most modern CPUs tend to use integer operations for branching. Also, this in-band signaling probably would invite something similar to `null`
59.
▲
by
lock1
1y ago
That's called "ones complement", the most significant bit represents a sign. Like the sibling post mentioned, it does have a weird quirk of having 2 representations for 0: (-0) and (+0). While "twos complement" turn
60.
▲
by
lock1
1y ago
IMO, rather than focusing on flexibility vs inflexibility when deciding "tight domain model" or not, it's much better to think about whether your program requirement can tolerate some bugs or not. Say we have a perfect "
More ›