HNHacker News
TopNewBestAskShowJobs

needlesslygrim

63 karma · joined August 9, 2023

submissionscomments
needlesslygrim··on Watching Go's new garbage collector move through the heap
> Unity's GC is unique in that it has an incremental marking phase.

Does ZGC not also have an incremental marking phase?

needlesslygrim··on Why Objective-C
While Swift now has the `borrowing` and `consuming` keywords, support for storing references is nonexistent, and the only way to return/store `Span`s, etc, is only possible through using experimental `@lifetime` annotations.

Swift is a nice language, and it's new support for the bare necessity of affine types is a good step forward, but it's not at all comparable with Rust.

needlesslygrim··on Ruby Symbols
> extremely inefficient strings (erlang)

Doesn't most modern Erlang code use binaries instead of charlists? Elixir and Gleam certainly do.

needlesslygrim··on Systems Programming with Zig
> Rust has some support for zero-runtime, but a lot of it's features is either useless of outright in the way when you are not using a heap.

Could you give some examples?

needlesslygrim··on Framework Laptop 16
That's good to hear, I guess it's possible a thicker module could be made in the future with more cooling potential?
needlesslygrim··on Framework Laptop 16
I'm very impressed you managed to get nvidia to give you access to the 5070! I have one queetion though, is the 5070 limited to 100W because of the docking connector, or for cooling reasons?
needlesslygrim··on Using Microsoft's New CLI Text Editor on Ubuntu
That makes sense, and it's interesting that both you and Linus Torvalds maintain your own versions of Micro Emacs. Sign of greatness perhaps :)
needlesslygrim··on Using Microsoft's New CLI Text Editor on Ubuntu
I'm curious, why don't you use GNU Emacs?
needlesslygrim··on Four Lectures on Standard ML (1989) [pdf]
Oh I see. I assumed being able to explicitly yield unit meant statements were essentially just syntax sugar for unit. Thanks for the correction.
needlesslygrim··on Four Lectures on Standard ML (1989) [pdf]
Well, Rust barely has statements [1]. Nearly everything in Rust is an expression, and AFAIK statements /are/ essentially expressions that yield `()` [2].

[1]: https://doc.rust-lang.org/reference/statements.html

[2]: https://play.rust-lang.org/?version=stable&mode=debug&editio...

needlesslygrim··on Google will develop Android OS behind closed doors starting next week
In China WeChat is the dominant messaging platform, SMS is only used for delivery notifications, spam, etc.
needlesslygrim··on Ask HN: A retrofitted C dialect?
That's probably fair.
needlesslygrim··on Ask HN: A retrofitted C dialect?
> Async Rust is painful

On the other hand, I've found normal threading in Rust quite simple (generally using a thread pool).

needlesslygrim··on Roc rewrites the compiler in Zig
Well if you're going to eat crow, I may as well eat pigeon, for I didn't realise that paper wasn't showing real source.

Thanks for the link to the LCF text though :^)

needlesslygrim··on Zig; what I think after months of using it
I think this criticism is silly. Here's what your first example would look like in a language with keywords (where reasonable, perhaps like C#) instead:

  pub fn play<lifetime p>(in out self, player: mut ref AnimationPlayer lifetime p, new_animation: AnimationNodeIndex, transition_duration: Duration) -> mut ref AnimationPlayer lifetime p
But, this is still confusing! Let's remove even more symbols, and make the syntax more obvious by removing abbreviations:

  PUBLIC FUNCTION Play
  LIFETIMES
    P
  PARAMETERS
    IN OUT Self
  Player AS MUTABLE REFERENCE TO AnimationPlayer WITH LIFETIME P
  NewAnimation AS AnimationNodeIndex
  TransititionDuration AS Duration
  RETURNS MUTABLE REFERENCE TO ActiveAnimation
  BEGIN
  ...
  END
IMO, using keywords instead of symbols for references, lifetimes, etc, would just make Rust overly verbose, and there's a reason BCPL used braces instead of BEGIN/END :^)
needlesslygrim··on Roc rewrites the compiler in Zig
Well, ML (or at least the first versions of it) used a λx • x syntax [1] for λ-abstractions, the same (excluding the use of • over .) notation as used with the Lambda Calculus, and I've always assumed \ was an ASCII stand in.

[1]: https://homepages.inf.ed.ac.uk/wadler/papers/papers-we-love/... (can be spotted on page 353)

needlesslygrim··on "We're building a new static type checker for Python"
Unfortunately, while `dynamic` is used for dynamic typing in C#, `var` is just type inferenfe like `auto` in C++.
needlesslygrim··on Swift for C++ Practitioners: Move Semantics
This is interesting because these semantics seems to be a direct(ish) clone of Rust's. I wonder if this moves Swift's performance ceiling closer to Rust's?
needlesslygrim··on Ghostty 1.0
I'm also interested in why the MIT license was chosen. I guess it's because of the plan to create 'libghostty'?
needlesslygrim··on Fault Report – and alternative to Result in F#
I agree, this doesn't seem to be much better than adding `throws Throwable` to all your methods that can fail in Java. The reason sum types are so useful for error handling is that all possible cases can be exhaustively checked against at compile time.
needlesslygrim··on Translating 10M lines of Java to Kotlin
There are, at least in my opinion, many more reasons to use Kotlin than null-safety and data-classes/records, especially on Android (Jetpack Compose).
needlesslygrim··on Java in the Small
> I never said it is used extensively by most programs

True, but to make use of Rc/Arc in Rust comparable to the use of GC in Java, almost evrery value would have to be wrapped in one, something I would think is quite rare.

> only that most programs do use it

I would still be interested in seeing statistics for this though. I have only ever used Arc once, and it was only to share a Mutex containing the program's database across threads.

> What's the difference between a standard library and a runtime?

I would say there are three main differences: - A runtime is (usually?) not optional - see languages like C#/Java/Python that require some sort of higher 'power' to manage their execution (interpreting/JITing code, GC management, etc), or crt0 - compared to a standard library which is just some extra code - see the C standard library function strlen() - A standard library can generally be implemented in the language itself. I think this is where the distinction starts to get a little fuzzier, with languages like Roc (its standard library is implemented in Zig), and Haskell (I would assume much of the side-effecty code like the implementation of IO is in C) - The purpose of a standard library is generally to provide 'helper' code that you wouldn't want to write yourself, e.g. Vec<T>, HashMap<T>, filesystem functions, etc. On the other hand, the purpose of a runtime is, per the first point, to manage the execution of the language, etc.

> I never said that LLVM was a JVM

True again, my point was worded badly. I didn't mean to suggest you thought LLVM was a JVM, rather to draw a distinction between LLVM and a Java/.NET style VM. LLVM used to stand for Low Level Virtual Machine, and the JVM has instructions like instanceof (which, fairly obviously, checks if a reference is an instance of the named class, array, or interface type). They operate at quite different abstraction levels, and the JVM is a lot more similar to the CLR.

> Now, it is true that Rust is typically (though not always) compiled to native code AOT

I would be genuinely interested in finding about a JIT compiler for Rust.

EDIT: it's worth me mentioning none of this is backed by any formal education (I'm 18), so it is very possibly wrong.

needlesslygrim··on Java in the Small
I'm interested by your characterisation of Rust. I assume 'crude GC' is a reference to Rc/Arc, but I would be interested to see some statistics for the claim most programs written in Rust use them extensively. Also, Rc/Arc arent a part of any Rust 'runtime', but rather the standard library, and are not available when they eould not be suitable for the target, e.g. UEFI. Moreover, rustc compiles to LLVM IR, but LLVM is not a JVM/CLR VM, and rustc is not the only Rust compiler (though the others are admittedly not production-ready yet).
needlesslygrim··on I'm not mutable, I'm partially instantiated
I'm curious, how does Swift have better pattern matching than Rust?
needlesslygrim··on Rust's Ugly Syntax (2023)
Good to know, also cool that you replied!
needlesslygrim··on Rust's Ugly Syntax (2023)
I assume it's derived from the OCaml generic type syntax (the first Rust compiler was written in OCaml after all), for example the definition of the type `Option.t` in OCaml:

  type 'a t = 'a option = 
  | None
  | Some of 'a
I think this is the case because IIRC this function:

  fn slice<'a>(s: &'a str) -> &'a str { &s[0..2] }
Is generic over the lifetime of `s`, and it I assume it would have been difficult to distinguish generic types and lifetimes.
needlesslygrim··on Android features I envy as an iPhone user
I'm pretty sure that's the intended behaviour, and I personally quite like it, but I'm used to Android so shrug: https://developer.android.com/guide/navigation/principles
needlesslygrim··on Robert Fripp Announces King Crimson Supergroup Beat
I'm 17 and King Crimson is one of my favourite bands, and I know other people at school who like them so you'd probably be surprised.
needlesslygrim··on Our next-generation model: Gemini 1.5
Well that was easy [0]. The second draft also revealed something about the prompt [1]. It seems that the more verbose the prompt is, the less it wants to reveal [2] [3]. Unfortunately I don’t seem to be able to get it to reveal anything more, and it refuses to cooperate with me when I try the ‘Developer Mode’ prompt which used to work on ChatGPT [4].

[0] https://g.co/gemini/share/fa9d60da921d

[1] https://g.co/gemini/share/e20655d06292

[2] https://g.co/gemini/share/f11bc9f7e658

[3] https://g.co/gemini/share/c04c933f838b

[4] https://news.ycombinator.com/item?id=34974048

needlesslygrim··on Our next-generation model: Gemini 1.5
I'll see what I can do, but I don't expect I'll achieve much.
Page 1 of 2Next →