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

How come such a large portion of the code is generated?


It sounds like boilerplate Java.


>You can generate those conversions, most people do.

Hi, what do people use to generate them, I found gserde (edit: and glerd-json)


There’s several options, depending on what you want. The most commonly used option is the language server.


Oh nice, didn't know about it. (I have migrated from vim to neovim and half of it doesn't work for me yet)

I wonder why this is preferred over codegen (during build), possibly using some kind of annotations?


We've not had any proposals for a design like that. We are open to proposals though! I wrote a blog post detailing the process here: https://lpil.uk/blog/how-to-add-metaprogramming-to-gleam/


The language server code action :)


I understand the comparison with C (the memory management) but I wonder how do you compare Rust to Java? What is it that makes you feel more confident in Rust compared to Java?


Java _used_ to give me that "it just works" feeling when I started using it... in 1999. The rich type system makes the biggest difference. In Rust, you can solve a problem by first modelling it through structs and enums and then define operations pertaining to elements of the model. rustc (the compiler) has such a grasp on the implications of a given model that it will most often guide you toward a near-optimal (and safe) solution that ends up working flawlessly the first time you get it running.


Rust has a cool type system, but I think you give it much more credit, like it doesn’t have dependent types where the implementation can often be filled in literally.

Other than checking mutability and nullness, I really don’t think that Rust would be that much ahead compared to even an “older” language like Java.

Also, java now has ADTs so “exhaustive checks” are available there as well.


I can't compare with Java, but I can for C#. With Rust I find that I have much more confidence that I understand what the code is doing primarily due to the borrow checker and how Rust enforces unique vs shared access vs ownership. Just by knowing the types involved, I know exactly what a function could potentially do to what I pass in just by looking at the call site.

In C#, I can't tell at the call site whether a function could mutate what I pass in; not without looking at the implementation of the function and anything it passes that object to. With Rust, how it's passed in completely informs me about this. If it's passed by shared reference, it can't mutate. If it's passed by unique reference, it might mutate. If it's passed by ownership, then I can't access the instance any more anyway, so it's not my problem.


I think you shouldn't compare Rust to Java (the language), you should compare it to Java (the ecosystem). The JVM is rock solid and very performant, and you have languages like Java++ (called Kotlin) and Haskell# (called Scala), or even Common Scheme (called Clojure). The same is true for the ecosystem, eg. build tools (Maven/Gradle are the default ones, but there are many more), frameworks (Spring + all the reactive stuff), the largest number of libraries on the planet after C, and so on.

The target niche is not exactly the same though, you wouldn't want to systems program on the JVM, and it would probably not make much sense to choose Rust over Spring Boot for web programming. YMMV of course.


You're right that with regards to memory management, using Java over Rust doesn't make me any more nervous. The things I really miss are at the type level. Small things like the compiler forcing you to be explicit about mutability. Large things like Rust enums and pattern matching which make it easy to model complex workflows without worrying about missing any cases.

Let me also make clear that I like the direction Java is moving (even if is taking decades) For example, something I look forward to in Java is pattern matching on switch expressions, which just got added as a preview feature in the latest LTS.


No null pointers, and no data races when you're working with threads.


From the previous Ask HN: https://news.ycombinator.com/item?id=26911830

- radiooooo.com

- nts.live

- poolside.fm

- lofi.cafe

- radioclassique.fr

- DI.fm


I enjoy listening to https://noodsradio.com/ - no ads and very often new and interesting music to discover


could you recommend some?


I don't even know what the other joins are


do you have anything we can see ?


Still pretty early stages. And I still have some decisions to make regarding the architecture of it. I'd like to do a ShowHN (my first), in the near future.


Growth? That's not good for stablecoins


Growth in terms of supply and usage, not the notional value of a unit.


Isn't it growth as in usage rather than value? I thought stablecoins were locked to a currency?


I don't understand why publishing a new version of a package breaks 1000000s of existing apps?

Do you not depend on a specific version? Do you not use checksums for dependencies?


Because by default in NPM you reference version ranges using ~ and ^ operators. For sure in a corporate environment no one has time to polish dependencies to specific versions.


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

Search: