L
Leah Hanson
blog.leahhanson.us · Personal blog · on HN since 2013
Leah Hanson is a programmer who writes about Julia internals, Haiku OS, Go parsing and the Haiku vector icon format.
What HN saysHN commenters mostly cite her post on the Haiku Vector Icon Format as a comparison point for vector image and icon formats.
17HN people shared it
10linked it in comments
18stories submitted
843story points
11 months agolast shared
2013people per year2026
Most-shared posts
- 1500 Byte Images: The Haiku Vector Icon Format (2016)11 people · 690 points · first shared 2016 · 91 comments on HN
- 2Julia introspects: see the AST, LLVM IR, and native assembly for any function2 people · 105 points · first shared 2013 · 30 comments on HN
- 3Learning Go: Lexing and Parsing2 people · 4 points · first shared 2016 · discussion on HN
- 4Julia Calling Python Calling Julia...2 people · 3 points · first shared 2013 · discussion on HN
- 5Falling for Haiku OS1 people · 15 points · first shared 2016 · 3 comments on HN
- 6Julia Functions for Exploring Functions (and Types) in Julia1 people · 7 points · first shared 2013 · discussion on HN
- 7Using Shell Commands In Julia1 people · 3 points · first shared 2013 · 1 comments on HN
- 8Hello, Haiku: Writing Your First Program For Haiku OS1 people · 3 points · first shared 2013 · discussion on HN
- 9Falling for Haiku OS1 people · 3 points · first shared 2013 · discussion on HN
- 10A First Parallel Program in Rust1 people · 2 points · first shared 2013 · discussion on HN
- 11Using TCP Sockets in Julia1 people · 2 points · first shared 2013 · discussion on HN
- 12Hello, Haiku – Writing Your First Program for Haiku1 people · 2 points · first shared 2016 · discussion on HN
- 13A Simple Monad Tutorial1 people · 2 points · first shared 2013 · discussion on HN
- 14Running Shell Commands from Julia1 people · 2 points · first shared 2014 · discussion on HN
- 15Julia introspects1 people · first shared 2018
What HN people wrote when they linked it
minhmeoke · 2021-08-30
Your project is quite impressive. And welcome to the world of computer graphics!
I'd consider taking inspiration from the following sources:
1. GUI toolkits like QT QML [1] or Android [2]. These typically build a hierarchical tree of different components (eg: start with a root window, which contains panes, which in turn contain text and buttons). Each component may contain different properties (eg: font, color), and properties may be inherited from the parent component.
Advantages:
+ preserves semantics of component properties and how they are linked to each other (eg: the caption is below the image)
Disadvantages:
- complexity: building a layout/constraint engine can be difficult, or alternatively you can use absolute positioning with relative offsets which can be tedious to use (in this case the layer-based approach below might make more sense).
[1] https://en.wikipedia.org/wiki/QML
[2] https://developer.android.com/guide/topics/ui/declaring-layout
2. Graphical editor programs like Gimp or Photoshop, or Adobe Flash.
These build up a screen as a collection of vertically stacked layers or assets (eg: graphics, text, etc) with attached properties and optionally bounding boxes. Higher layers/assets occlude the content of the layers below them, so you would need to implement some kind of visibility logic.
Advantages:
+ simplicity
+ you can use identifiers for assets, and therefore don't need to perform pixel-by-pixel comparisons.
Disadvantages:
- may lose some…
IIsi50MHz · 2025-12-05
Haiku (OS) caches the vector icons rendered from HVIF[1][2] files which are used extensively for UI.
I didn't find details of the caching design. Possibly it was mentioned to me by waddlesplash on IRC[3].
[1] 500 Byte Images: The Haiku Vector Icon Format (2016) http://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html
[2] Why Haiku Vector Icons are So Small | Haiku Project (2006) https://www.haiku-os.org/articles/2006-11-13_why_haiku_vector_icons_ar…
[3] irc://irc.oftc.net/haiku
Lammy · 2024-06-22
m_eiman · 2021-12-21
It would be interesting to see how it compares to Haiku Vector Icon Format, which shares some of the same priorities. Some more info:
https://en.wikipedia.org/wiki/Haiku_Vector_Icon_Format
http://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html
maxxk · 2021-06-05
It would be interesting to compare this representation with Haiku vector image format described in post [0] and discussed a couple of times here [1, 2].
0: 500 Byte Images: The Haiku Vector Icon Format
http://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html
1: https://news.ycombinator.com/item?id=12420763
2: https://news.ycombinator.com/item?id=22373422
DHowett · 2020-12-24
Haiku has a clever solution to the problems presented by vector images at smaller sizes: Haiku Vector Icon Format (HVIF)¹².
HVIF supports only basic shapes with integer coordinates (by default) and detail reduction. Each shape is tagged with a minimum and maximum scale³--computed from a base icon size of 64x64--at which it should be visible. Rounding and hinting bring those shapes within tossing distance of custom-drawn icons at small scales.
¹ Leah Hanson's post is quite illuminating, though it focuses more on the small on-disk size of HVIF data; http://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html
² https://web.archive.org/web/20070111153750/http://haiku-os.org/node/28…
³ "stippi"'s original announcement: https://www.freelists.org/post/haiku/Icon-Artwork
joveian · 2020-03-11
Arguably it might be better to include a limited, space-optimized vector image format (something like HVIF, Haiku Vector Icon Format[0]) along with text rather than try to enumerate emoji, although there are also advantages to the current approach (smaller size for supported characters and meaning indpendent of representation). For the web there is already data: url and similar inline image options would be possible in many situations even without the basic text format including images.
[0] https://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html
e12e · 2018-08-31
One practical "high level" example would be analyzing function/type specialization in Julia and understanding the resulting code that can be easily inspected.
See eg (from 2013, but at a glance seem to outline the ideas well):
http://blog.leahhanson.us/post/julia/julia-introspects.html
For Julia - it's fairly easy to work "high up" most of the time - and drop down inspecting the code (and profiling) - and unlike many other languages, even high pref libraries will often be julia all the way down (unlike tcl/perl/ruby/python + c/fortran etc).
https://docs.julialang.org/en/stable/manual/profile/
https://docs.julialang.org/en/stable/devdocs/reflection/
Similar for sbcl (common lisp) or various languages that target/use llvm. And obviously for looking at output of optimizing compilers for c, c++, rust, d and similar "medium to high" level languages (Pascal, Ada, crystal, etc).
StefanKarpinski · 2014-09-06
Some details here: http://blog.leahhanson.us/julia-introspects.html.
jamesjporter · 2014-01-23
This already exists as a prototype as part of IJulia, see Leah Hanson's awesome blog post about it here: http://blog.leahhanson.us/julia-calling-python-calling-julia.html
The collaboration between the scientific Python and Julia communities in recent months has been awesome to watch.