Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
leshow
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
181.
▲
Nailgun: A Rust DNS performance testing client
(leshow.github.io)
45 points
by
leshow
5y ago
|
10 comments
182.
▲
by
leshow
5y ago
Oh sorry, you were saying lack of generics were the reason you could make sense of code easily, implying that if a language has generics you can't make sense of it. That seems juxtaposed to having used them for decades. In any case I c
183.
▲
by
leshow
5y ago
I'm well aware when they are useful, I've been using them in languages for the past 10 years. By the same token though, leaving type parameters out of the language has had far reaching implications outside of this "narrow&quo
184.
▲
by
leshow
5y ago
It's not as if it's a niche problem requiring a niche solution though. The problem is "how do I write my own data structures" and to the best of my knowledge Go's answer is: copy-paste everything and edit for each c
185.
▲
by
leshow
5y ago
If you use something like nextjs and strict compiler options for TS a lot of these concerns go away. > You get everything you need out need out of the box. This is specious. There's lots of comments about how you don't get ever
186.
▲
by
leshow
5y ago
Will we? It's not as if there is some countermeasure that will magically even the playing field, things seem to advance in the direction of escalation vs countermeasure.
187.
▲
by
leshow
5y ago
AFAIK Elm can't actually write to the filesystem, how does the compiler get around that? Or has Elm changed such that it can work outside the browser now?
188.
▲
by
leshow
5y ago
> I imagine it's &TcpStream because the TcpStream is used by both the reading and writing halves. Yes, and in fact in older versions of tokio reading and writing required &mut, even for things like UdpSocket, which was a bit
189.
▲
by
leshow
5y ago
> In Rust, if you're actually doing any compute work, you're stalling out the async system. In Go, if you compute for a while, the scheduler will let someone else run. You can get all the CPUs working. This is well matched to w
190.
▲
by
leshow
5y ago
As far as I can tell there is no parallelism in this code (fyi rust doesn't have a uint32 type), if you want things to run in parallel you need to spawn a task just as you do with threads. Async gives you concurrency, each formerly blo
191.
▲
by
leshow
5y ago
How so? Not to start the old windows vs linux flamewar but if something in Windows doesn't work the way you want it you don't have many options. In Linux you can change absolutely everything... and people have been making it "
192.
▲
by
leshow
5y ago
Happy birthday Rust! It's crazy to think personally that it's been 6 years since I stumbled on this little esoteric language on hacker news and decided it might be fun to learn. Ended up changing the trajectory of my career in a b
193.
▲
by
leshow
5y ago
Nitpick: "expensive" may be the wrong word there, to me that implies some kind of runtime cost. The stated reason for the keyword is that it forces users to think a little bit more about mutability. You may want do this because sa
194.
▲
by
leshow
5y ago
Depends what you're looking for I guess. Linux desktops can be highly configurable and give you an environment that's not attainable on any other OS. Think like tiling wms & polybar/rofi/customized terminals. Unless
195.
▲
by
leshow
5y ago
Monomorphization is not a user action of copy pasting, it's something the compiler does with parametric code. If we're talking about Rust it means when you write: fn id<T>(t: T) { } fn main() { id(String::f
196.
▲
by
leshow
5y ago
I think the vertical resize of the "before" is the wrong one. Shouldn't it be also resizing the window next to it?
197.
▲
by
leshow
5y ago
It's not just luke, here's a couple more, two of these I remember in particular the others are just from a google search https://reasonablypolymorphic.com/blog/elm-is-wrong/ https://dev.to
198.
▲
by
leshow
6y ago
What do you do with them in the summer? What about warmer climates where you don't need a heater?
199.
▲
by
leshow
6y ago
> I didn't know that, which is why I thought "|| async move ..." was some weird form of pseudo-async-closure instead of what it is: a function that returns an async function. It does not return an async function, it is a c
200.
▲
by
leshow
6y ago
Well, no, that second one isn't valid rust, perhaps you mean: move || async move {} But this is not equivalent to: || async move {} crucially the closure is not going to take ownership of anything. This is kind of besid
201.
▲
by
leshow
6y ago
I skimmed some of this, but are you asking why you need to clone in the closure? Because "async closures" don't exist at the moment, the closest you can get is a closure that returns a future, this usually has the form:
202.
▲
by
leshow
6y ago
Oddly, I would argue that the shorter words are better also "for readability".
203.
▲
by
leshow
6y ago
Take this with a grain of salt but from the little examples I've seen it looks like a nightmare for any type of large application. I would much rather have increased power in the type system rather than having arbitrary code run and fa
204.
▲
by
leshow
6y ago
What's the use case? I'm trying to think of a situation where you'd want to do that were you might not just make a separate binary that uses the other allocator
205.
▲
by
leshow
6y ago
fn read_keys(port: #[cfg(feature = "splitapple")] nrf52840_hal::pac::P1 #[cfg(feature = "keytron")] nrf52833_hal::pac::P0) -> Packet {} I'm not s
206.
▲
by
leshow
6y ago
really? for a word you're going to write potentially hundreds of thousands of times you prefer to write out "function" because "fn" is not clear enough? Short keywords improve readability in a big way, IMO. There&#x
207.
▲
by
leshow
6y ago
> Even Rust (last I checked) defaults to assuming some global one-size-fits-all allocator. You can substitute whatever allocator you want: https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html Unless you&#
208.
▲
by
leshow
6y ago
> You could do those things in C++ with template games and in Rust with macros. But Zig lets you have immense expressivity with a simple, small and easy-to-learn language. const fn is (or seems to me to be) exactly what comptime is thoug
209.
▲
by
leshow
6y ago
This discussion feels incomplete without mentioning "return-free filing". A lot of countries you don't even need to send a return because the government already has all the info you need. https://www.taxpolicycente
210.
▲
by
leshow
6y ago
That seems pretty short sighted
More ›