Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ianthehenry
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
ianthehenry
2y ago
i think this is just very badly worded. the initial conditions are current=8, previous=41, not the other way around. i should make that more clear
32.
▲
by
ianthehenry
2y ago
ha thanks, you are absolutely right. i updated the table :)
33.
▲
by
ianthehenry
2y ago
You point out a good general problem that I find when blogging -- like, you don't want this, right? The whole premise is absurd; the point is not to memoize an expression, but rather to demonstrate that you can share values between c
34.
▲
by
ianthehenry
2y ago
this is a very funny way to do this, thanks! i was thinking of using the (deprecated but still widely supported(?)) `caller` property but was sad that it wouldn't admit multiple memoization dictionaries per calling function (also would
35.
▲
Quote-unquote "macros"
(ianthehenry.com)
101 points
by
ianthehenry
2y ago
|
70 comments
36.
▲
by
ianthehenry
3y ago
Can someone explain the backstory of what V is and why someone took the time to write this? To the uninitiated this sounds like someone criticizing some kid’s side project. I’m picking up some context clues that V is widely used / famo
37.
▲
by
ianthehenry
3y ago
Janet’s value proposition is pretty similar to Lua — easy embedding, simple C API, minimalist runtime. But Janet improves on some weird Lua warts (block-scoped variables by default, 0-indexed collections, separate types for sequential and a
38.
▲
by
ianthehenry
3y ago
If you aren't familiar with SDFs, some rough intuition for what's going on here: you have some primitive functions that define shapes, you have combinators that distort shapes, and you then have combinators that distort space . A
39.
▲
Domain Repetition
(iquilezles.org)
132 points
by
ianthehenry
3y ago
|
10 comments
40.
▲
by
ianthehenry
3y ago
Yeah, it's really pretty simple -- there's a CSS rule `image-rendering: pixelated;` which sets it to use nearest-neighbor resampling. Then you render a canvas that's half the width of your screen and scale it up. You kinda ha
41.
▲
by
ianthehenry
3y ago
Yeah, if you swap the initial conditions, you get a different sequence of values. You’re starting with 8 41, but the sequence in the article starts with 41 8.
42.
▲
by
ianthehenry
3y ago
The example is showing current=8 previous=41, not current=41 previous=8. I think I did the math right from the those (weird) initial conditions, but maybe not. It converges either way! Good call on the wording there, though -- changed it
43.
▲
by
ianthehenry
3y ago
That's such a good idea! Sadly I am at work right now so I can't hack on it for a while, but I love it
44.
▲
The Fibonacci Matrix
(ianthehenry.com)
161 points
by
ianthehenry
3y ago
|
23 comments
45.
▲
by
ianthehenry
3y ago
Hmm, I like mutation testing, and have found it very useful, but I don't know if it feels any different with this technique as it does with traditional assertion tests. Perhaps one difference is that, when you find a hole in your test
46.
▲
by
ianthehenry
3y ago
Mutation testing is where you make changes to your code's logic as a way to ensure that you have good test coverage for that bit of logic. Mutation testing is helpful with any kind of tests -- assertions, snapshots, whatever -- as a
47.
▲
My Kind of REPL
(ianthehenry.com)
87 points
by
ianthehenry
3y ago
|
12 comments
48.
▲
by
ianthehenry
3y ago
To provide a some extra context for other readers and mostly respond to the GP: Janet does not do any stripping for distribution -- Janet images compiled to native executables still contain the full compiler/stdlib/runtime/ev
49.
▲
by
ianthehenry
3y ago
From the post: > Even without explicit mode annotations, the compiler can statically determine which variables may escape their enclosing region. Such variables are assigned the global mode; all others are automatically inferred to be lo
50.
▲
by
ianthehenry
3y ago
> Right, but the complete argument isn't "there are other ways to do this", the argument is "there are other ways to do this, and nearly every one of them is less error-prone". I feel like there's such a wid
51.
▲
by
ianthehenry
3y ago
I think you're making very reasonable points in this thread :) > This post persuaded me to not take much of a look at Janet. I feel I should say that you shouldn't form too much of an opinion about Janet just because one person
52.
▲
by
ianthehenry
3y ago
Oh whoops! That’s what I called them in my prototype so I didn’t shadow Janet’s built-ins. Forgot to update that one when I copied it to the blog post :)
53.
▲
by
ianthehenry
3y ago
I think that a zipper would provide a much nicer interface for making "distant" transformations, but just to be clear you can traverse the entire AST with this approach by recursively returning macros that return macros and then
54.
▲
Generalized Macros
(ianthehenry.com)
97 points
by
ianthehenry
3y ago
|
74 comments
55.
▲
by
ianthehenry
3y ago
Mm, I don't think it makes a lot of sense to compare Janet and Racket. They're so different that they aren't really bidding for the same projects -- you could ask the same question about Janet and Python, or Janet and Ruby, o
56.
▲
by
ianthehenry
3y ago
Hmm, maybe? https://janet.guide/janet-for-mortals.epub That's a super hacky epub that I just generated from the markdown source and have not read over thoroughly. Formatting is a bit different, and code blocks have no
57.
▲
by
ianthehenry
3y ago
This is actually true of Janet as well, although it is not as nicely supported as it is in Racket. You can "bring your own parser," but still leverage the Janet bytecode compiler and runtime. Sort of... an advanced topic, though.
58.
▲
by
ianthehenry
3y ago
I agree that Janet's approach is nicer, but here's an argument against it: if you unquote a function in a macro and then later redefine the function (like, while doing interactive development in the same running process), the macr
59.
▲
by
ianthehenry
3y ago
Depending on what you're doing, Janet might be a great fit! I wrote a DSL for [expressing and shading 3D shapes]( https://bauble.studio ), and it was pretty easy. Depending on exactly what you're trying to do, the ease o
60.
▲
Why Janet?
(ianthehenry.com)
405 points
by
ianthehenry
3y ago
|
135 comments
More ›