hnakamur
Re:Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest...
on Thursday July 15, 2021 @08:13PM (#27851696)
I agree. For example, most of Rust libraries uses the drop handler (something like desctructors) to close a file descriptor.
However it has problems since in async model closing is also async and it may return an error.
So in tokio-uring explicit async close will be provided.
https://github.com/tokio-rs/tokio-uring/pull/1/files#diff-3d...
And you can call close like: file.close().await.unwrap(); https://github.com/tokio-rs/tokio-uring/pull/17/files#diff-b...
Re:Durability: Linux File APIs
on Monday October 12, 2020 @08:04PM (#24760944)
Thanks for your pointer.
Do you mean this thread?
"Json-Base – Database built as JSON files | Hacker News"
https://news.ycombinator.com/item?id=23715558
Re:The Kivaloo Data Store
on Monday September 21, 2020 @02:35PM (#24546849)
previous discussion: https://news.ycombinator.com/item?id=2378110
Re:Io_uring By Example: cat, cp and a web server with io_uring
on Tuesday April 07, 2020 @03:01AM (#22800953)
How about https://github.com/quininer/io-uring ?
It is licensed under either of Apache2/MIT.
Re:Hermes – A small JavaScript engine optimized for running React Nati...
on Thursday July 11, 2019 @04:24PM (#20415434)
https://github.com/skiplang/skip
> The Skip project concluded in 2018 and Skip is no longer under active development at Facebook.
Re:Announcing Rust 1.13
on Thursday November 10, 2016 @08:22PM (#12926525)
In Go, I use https://github.com/pkg/errors these days and wrap errors with stack trace.
package main
import (
"fmt"
"io"
"os"
"github.com/pkg/errors"
)
func main() {
v, err := run()
if err != nil {
fmt.Printf("err=%+v\n", err)
os.Exit(1)
}
fmt.Printf("v=%d\n", v)
}
func run() (*int, error) {
a, err := foo()
if err != nil {
return nil, errors.WithStack(err)
}
b, err := a.bar()
if err != nil {
return nil, errors.WithStack(err)
}
c, err := b.baz()
if err != nil {
return nil, errors.WithStack(err)
}
return c, nil
}
func foo() (*a, error) {
return new(a), nil
}
type a struct{}
func (a *a) bar() (*b, error) {
return new(b), nil
}
type b struct{}
func (b *b) baz() (*int, error) {
return nil, io.EOF // some arbitrary error for demo
}
This prints a useful stack trace like below and you can know where the error occurred. $ go run main.go
err=EOF
main.run
/home/hnakamur/go/src/bitbucket.org/hnakamur/stacktrace-demo/main.go:31
main.main
/home/hnakamur/go/src/bitbucket.org/hnakamur/stacktrace-demo/main.go:12
runtime.main
/usr/local/go/src/runtime/proc.go:183
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:2086
exit status 1
Re:Node9: Inferno kernel with LuaJIT instead of the Dis virtual machine
on Saturday June 13, 2015 @10:29AM (#9711098)
Great work!
I created a build script for Node9: https://gist.github.com/hnakamur/13808187bf59e47456c3