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

I didn't know about https://docs.rs/temporal_rs/latest/temporal_rs/

I wonder if it has a chance to replace chrono and jiff in the rust ecosystem.


Yep, temporal_rs is designed with native Rust use in mind, so you should be able to use temporal_rs directly wherever you'd use jiff or chrono.

That being said, the library is designed to be specification conformant and with EcmaScript implementations in mind. There are some specific API choices made specifically for those clients.

That being said, we are always looking for feedback regarding the native Rust API. So feel free to try temporal_rs out and provide whatever feedback you'd like :)


Follow up from my previous article about rust closures. This time it looks into async closures.


This article discusses making captures more flexible: https://smallcultfollowing.com/babysteps/blog/2025/10/22/exp...

I agree it would be nice, in particular to make it easier to understand when learning the concept.


This reminds me of when I learned to program on my casio calculator.

There was a function to detect a key press which would return a number identifying the pressed key.

I needed to map that number to the letter printed on the key to print it on the screen. I don't remember whether there was no hashmap data structure or I just didn't know about it, but I implemented it with a serie of if.

The problem with that solution is that while mapping A was fast, Z was very slow because it was at the end of the list. That is how I discovered divide and conquer/ dichotomy with if branches.


Just parameters that are functions, except that you can only have one per function. I still fail to see the advantage of blocks over being able to pass functions as arguments like in other languages.


One nice feature of blocks is that `return` will return from the enclosing function, rather than the block, so you can write:

    def find(x, l)
      l.each do |y|
        return y if y == x
      end
    end
Where in Lisp you'd use (return-from find x) and in other languages you might pass in a continuation or use a special return value protocol. It's a nice solution for higher order functions that are supposed to feel more language-level.

Also, you can pass functions as arguments like in other languages; lambdas behave like you would expect them to.


Yes, refreshing the page fixes the issue.


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

Search: