Better HN
topnewbestaskshowjobs
Log inSign up

slightknack

311 karma · joined Sep 2, 2019 (7y ago) · 70 submissions

A software architect who likes language design, RL, and impressionist paintings.

[ my public key: https://keybase.io/slightknack; my proof: https://keybase.io/slightknack/sigs/WcaeY2T7Yk1zxtpKL0lKKQ_8EfoCF5pReRxzOEDSUcI ]

Submissions

comment 1y ago · link · parent

The minimaxir/gemimg repo is pretty cool, fwiw.

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:

https://goto.isaac.sh/image-style-transfer

comment 4y ago · link · parent

In my opinion, writing derivations in Guile Scheme, using Guix[0], is a breath of fresh air[1]. If only the ecosystem were as large as Nix's...

[0]: https://en.wikipedia.org/wiki/GNU_Guix

[1]: https://goto.isaac.sh/guix

comment 4y ago · link · parent

> He identified the four forces which act on a heavier-than-air flying vehicle: weight, lift, drag and thrust. [...] He also designed the first glider reliably reported to carry a human aloft. He correctly predicted that sustained flight would not occur until a lightweight engine was developed to provide adequate thrust and lift. The Wright brothers acknowledged his importance to the development of aviation.

— 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

A language with a function-color-agnostic effect system, generic over asynchronicity?

comment 4y ago · link · parent

I mocked up a prototype for something similar to this using TreeSitter and its query language the other day for some heavy refactoring I had to do. This looks like a really cool project, will have to try it out!

comment 4y ago · link · parent

I had a little too much fun...

    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...

comment 4y ago · link · parent

I love Actual, one of the best local-first apps I've used. I'm excited that it's been open sourced, but I also understand that this release is a bit bittersweet. Awesome work James, best of luck in your future endeavors :)

comment 4y ago · link · parent

Thanks for the link to the guidelines: I removed the 'Show HN' prefix as this project isn't anything quantifiable yet. I'll be sure to post a proper Show HN when I've got something to show.

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

Don't forget the built-in chat in google docs that nobody uses! (Yes, the one other than the commenting system).

comment 4y ago · link · parent

We shouldn't have to live in a culture when being called out for making a 'choice with tenuous political relevancy' is socially expected, and something someone is 'guilty of'.

comment 4y ago · link · parent

Like you, I am not a huge fan of JS, but I'd like to say that the ideas behind TermKit — namely having a shell with richer graphical interaction (e.g. cat works for images too), semantic awareness and tokenization of commands, rich autocomplete, etc. — were ahead of their time.

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

Just letting you know, it's also the name of a pretty well-known suit of cards present in decks of playing cards.

https://en.m.wikipedia.org/wiki/Spades_(suit)

comment 4y ago · link · parent

This is a neat idea. Would love to run some queries against this with a larger index. Here's one instance of the question just going over the transformer's head, I guess:

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

Yes, but this almost seems intentionally genius at the same time.

comment 4y ago · link · parent

A snapshot is a the entire state of a program at a single moment in time. Continuations are basically exposed snapshots, i.e. taking a snapshot, storing it in a variable, doing some work, and then 'calling' the snapshot to return to an earlier point. Continuations allow you to implement a naive version of single-shot delimited continuations - coroutines! This can be very useful for modeling concurrency.

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

I've written some documentation for it in the past, but had to scrap it because things tend to move so quickly that it's better to read the code and ask Shaw than use incorrect documentation. As things stabilize, these issues will be resolved, but it's very bleeding-edge right now.

comment 4y ago · link · parent

Oh, I did something like this a while back as well! Aside from ray tracing, my renderer also supports ray marching, so it can render some cool fractals[1]. Writing path tracers is so much fun, love the write-up!

[1]: https://github.com/slightknack/keikan#readme

comment 5y ago · link · parent

> Tossing my hat in for Passerine [1]. Gorgeous ML inspired syntax.

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

Hey HN,

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

I vote that we add our blogs / other good blogs we have come across as children on this comment. I'll start, here's mine:

- https://slightknack.dev/blog

Here are some others:

- https://journal.stuffwithstuff.com

- https://www.gwern.net/index

- https://danluu.com

- https://tonsky.me/

- https://lemire.me/blog/

- https://waitbutwhy.com/

- https://www.kalzumeus.com/archive/

- https://blog.codinghorror.com/

comment 5y ago · link · parent

As someone who lives in Rome, it's about as quick to order a fresh pizza to go from a local restaurant as it is to get one from this vending machine. Alice Pizza is a popular pizza-to-go chain, but the place with what I think has the best pizza is Sementi la Pizza.

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

Because Passerine is pass-by-value, it only allows each reference to be owned by one object.

> 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

Thanks for your excellent questions. They're really helping me fuzz through my approach - I wish I had people I could do this with more often, haha. :P

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.

123