311 karma · joined Sep 2, 2019 (7y ago) · 70 submissions
[ my public key: https://keybase.io/slightknack; my proof: https://keybase.io/slightknack/sigs/WcaeY2T7Yk1zxtpKL0lKKQ_8EfoCF5pReRxzOEDSUcI ]
comment 1y ago · link · parent
Going further, one thing you can do is give Gemini 2.5 a system prompt like the following:
https://goto.isaac.sh/image-prompt
And then pass Gemini 2.5's output directly to Nano-Banana. Doing this yields very high-quality images. This is also good for style transfer and image combination. For example, if you then give Gemini 2.5 a user prompt that looks something like this:
I would like to perform style transfer. I will provide the image generation model a photograph alongside your generated prompt. Please write a prompt to transfer the following style: {{ brief style description here }}.
You can get aesthetic consistently-styled images, like these:comment 4y ago · link · parent
comment 4y ago · link · parent
— https://en.wikipedia.org/wiki/George_Cayley
I think by the time the Wright brothers came around, the general theory for powered flight was in place. The Wright Flyer was precision engineered, compared to most 'kites' that came before it. It's not every day you see an internal combustion engine on a kite.
comment 4y ago · link · parent
x>0.2-abs(sin(t*2))*0.05&&x<0.8+abs(sin(t*2))*0.05?(i%2?(min((x-sin(t%1.57)*0.3-0.5)*tan(-t%1.57)+cos(t%1.57)*0.3+0.5,(x-sin(t%1.57-1.57)*0.3-0.5)*tan(-t%1.57-1.57)+cos(t%1.57-1.57)*0.3+0.5)*0.4+0.5):(1-(min((-x-sin(t%1.57)*0.3+0.5)*tan(-t%1.57)+cos(t%1.57)*0.3+0.5,(-x-sin(t%1.57-1.57)*0.3+0.5)*tan(-t%1.57-1.57)+cos(t%1.57-1.57)*0.3+0.5)*0.4+0.5))):0.5
https://sliderland.blinry.org/#x%3E0.2-abs%28sin%28t*2%29%29...9.
I bought a short domain name. What should I do with it?(hb.sbs ↗)
11 points · by slightknack · 4y ago · 15 comments
comment 4y ago · link · parent
Maybe it's expected that TermKit-the-project died, but I don't think that TermKit-the-idea should: whether it be bringing features from the project as extensions to existing terminals (cat for images would be nice), or building a new TermKit built on modern graphics libraries powered by WASM/Lua/bring-your-own scripting language.
13.
Tell HN: GitHub is down (Update: Back online now)
188 points · by slightknack · 4y ago · 64 comments
comment 4y ago · link · parent
My question:
> how does google work
The response:
> A decentralized autonomous organization (DAO) is a software running on a distributed ledger that offers users a built-in model for the collective management of its code. To become a member of a DAO, users need to first join the DAO by buying its currency. Unlike traditional organizations, there is no hierarchy in DAOs. One of the key features of DAOS is the internal capital that is used to incentivize these actors and ensure that the organization runs smoothly.
comment 4y ago · link · parent
Aside from coroutines and continuations, snapshots are neat for distributed computing: spin up a vm, take a snapshot, and replicate it over the network. You could also send snapshots of different tasks to other computers to execute. In the context of edge computing, you could snapshot the program once it's 'warm' to cut back on VM startup time.
Snapshots allow you to peek into your program. Imagine a debugger that takes snapshots on breakpoints, lets you to inspect the stack and heap, and replay the program forward from a given point in a deterministic manner. You could also send a snapshot to a friend so they can run an application from a given point on their machine. If you do snapshots + live reloading there are tons of other things you can do (e.g. live patching and replaying of functions while debugging).
comment 4y ago · link · parent
comment 5y ago · link · parent
I work on Passerine, cool to see the language mentioned in the wild, glad you like it!
> Written in Rust, and I suspect scripting Rust libraries is in the cards.
We have a rudimentary FFI to Rust already in place. We're also working on a proc macro lib for creating high-level bindings to Rust types/functions/crates (currently unreleased). Also working on an algebraic-effect-based system-injection engine, which will replace the FFI in the 0.10.0 or 0.11.0 release :)
21.
Effective Concurrency with Algebraic Effects in Multicore OCaml(kcsrk.info ↗)
148 points · by slightknack · 5y ago · 59 comments
comment 5y ago · link · parent
Isaac Clayton again[0]! This summer I worked as an intern at tonari[1] where I developed algorithms for real-time 3D scene construction on the GPU. As a part of my research, I developed a library / tool for prototyping shader-based graphical pipelines on the GPU. This tool, Shadergarden[2], uses GLSL[3] for shaders, but introduces a lisp-like configuration language[4] for chaining shaders (and other transformations) into directed acyclic graphical pipelines. We've been using it for both art and research, kinda like a local Shadertoy.
Hope you enjoy the write up, have a nice day!
PS — If your browser automatically pauses videos, you might need to 'show video controls' to play some of the visualizations.
[0]: https://news.ycombinator.com/item?id=25347140 / https://news.ycombinator.com/item?id=26212491
[1]: https://tonari.no
[2]: https://github.com/tonarino/shadergarden
[3]: https://thebookofshaders.com/
[4]: https://github.com/tonarino/shadergarden/blob/master/LISP.md (When all you have is a compiler, everything's a DSL)
23.
Show HN: Shadergarden: Create reloadable graphical pipelines with Lisp and GLSL(blog.tonari.no ↗)
47 points · by slightknack · 5y ago · 2 comments
comment 5y ago · link · parent
- https://slightknack.dev/blog
Here are some others:
- https://journal.stuffwithstuff.com
comment 5y ago · link · parent
Just my own 2¢, I digress.
26.
Writing a Nanopass Compiler – Andy Keep [video](youtube.com ↗)
1 points · by slightknack · 5y ago · discuss
27.
How DAT Works: A Distributed Protocol for Sharing Data (2019)(datprotocol.github.io ↗)
2 points · by slightknack · 5y ago · discuss
comment 5y ago · link · parent
> So if some code somewhere hands me a list that contains references to some heap data, how do you track this?
Passerine is a high-level language, so it does not give the programmer control over whether something is a list of references to data on the heap or a list of values. Assuming `a`, `b`, and `c` have been defined, If I write this:
list = [a, b, c]
`a`, `b`, and `c` will be moved into the list upon construction. If I do something like: list = [a, b, c]
print (foo a c)
`b` will be moved into the list, and copies of `a` and `c` will be moved into the list.So, to now answer your question:
list = [a, b, c]
list = drop_first list
> We lost/dropped/gave up a. How do we know how a was tied to the stack?`a` was tied to the stack because it's in `[a, b, c]`, which is tied to the stack via `list`.
> How many other references might point at the object previously referenced by a? Can we collect that object now?
By definition, none - `a` is a unique value. Now that we dropped `a`, there are guaranteed to be no other references of `a`, so we can collect that object now.
> Is this the case where reference counting kicks in?
No, the reference counting is a small optimization for sharing immutable values in closures. If a closure captures a value, say a large list, we don't want to go around copying this willy-nilly:
big_list = [...]
c = () -> {
-- big list is copied when the closure is made
-- this happens because the reference in the closure can outlive local stack frame
a -> first big_list
}
-- these calls to c do not copy big_list again
a_outer = c ()
a_another = c ()
Closures need to copy values immutably to prevent the construction of cycles. I wrote a long explanation on why this is the case, but I've decided to move it to the blog post when I publish it. I thought of a way to efficiently count references acyclically, but I need to work it out before I made any more claims.Hope this helps!
comment 5y ago · link · parent
Anyway, something I realized after I posted that question is that assignment doesn't have to force a copy; for instance, this could just take a CoW slice reference to the original list:
[head & tail] = &rem'
The only requirement is that the value returned from a function is an owned value, not CoW. To avoid talking myself into circles, I'll show that `append` still works under this rule. It just moves the copy to the point where we construct the new list, rather that at the point where we de-structure it: loop [head' & acc'] tail'
So in `[head' & acc']`.For the code sample you provided, a reference would be passed down, rather than a copy of the entire list, so just the first two elements would be copied. Do you have any further questions regarding this? I'd like to be able to prove the soundness of this system, but I'm not sure going back and forth on example after example is the best strategy in the long run.
> In a functional language, insertion into a binary tree only copies nodes along one path in the tree. Would your language copy the entire tree instead, at potentially exponentially higher cost?
Most functional languages use persistent data-types, because all data in those languages are immutable. I haven't thought about how they'd work into Passerine, but if you mutate data that will be used later, a copy of that data will be made. So yes, mutating a tree makes a copy of it if the original tree is used later.
This is less of a problem then you'd think. It's common to write programs as series of transformations on data, so note that if you do something like this on a big million-element list children .map { child -> (child.name, child.age, child.hobby) } .filter { (_, age, _) -> age > 10 } .map { (name, _, hobby) -> (first_name name, hobby) } .filter { (_, hobby) -> is_fun hobby } .fold "" { (string, (name, hobby)) -> string + name + " enjoys " + hobby + "\n" } .print
No copies will be made, because each step is the last usage of the data-structure produced in the previous step.
> (I'm also slightly confused by your definition of append -- the accumulator seems to be a list, but then the initial call of loop would need to use [value] instead of value, no?)
Once again, correct.
> Regarding "tying references to the stack" I had another question here: https://news.ycombinator.com/item?id=26228961
I wrote a long response, to this, but it ended up being a couple thousand words, so I'm trying to trim it down. (I went off the deep end, with stack diagrams, explaining how cycles get created, etc, etc.) TL;DR for now is that you can't have a list of references, each object is only mutably 'owned' by one other. Once I trim down the response, I'll post it - should be sometime later today.