Bluish Coder
bluishcoder.co.nz · Personal blog · on HN since 2007
Chris Double (doublec) writes about programming languages and systems, including ATS, Factor, Pony, Rust, Self, and Inferno OS.
What HN saysCommenters recommend his ATS articles as the most accessible introduction to the language and cite his Factor posts and screencasts.
77HN people shared it
47linked it in comments
74stories submitted
1.2Kstory points
11 months agolast shared
2007people per year2026
Most-shared posts
- 1Namecoin - A DNS alternative based on Bitcoin [guide]6 people · 20 points · first shared 2011 · 1 comments on HN
- 2Ats5 people · first shared 2011
- 3Safer C Code Using ATS4 people · 24 points · first shared 2010 · 2 comments on HN
- 4Preventing heartbleed bugs with safe programming languages3 people · 118 points · first shared 2014 · 112 comments on HN
- 5A Quick Look at the Pony Programming Language3 people · 5 points · first shared 2015 · discussion on HN
- 6Sharing computer and phone resources using Inferno OS3 people · 3 points · first shared 2012 · discussion on HN
- 7Linking and calling Rust functions from C3 people · 3 points · first shared 2013 · discussion on HN
- 8Multiple Users in a Self World3 people · 2 points · first shared 2013 · discussion on HN
- 9Ranged integer types and bounds checking3 people · 2 points · first shared 2013 · discussion on HN
- 10Safer handling of c memory in ats3 people · first shared 2013
- 11Jsscheme3 people · first shared 2012
- 12Index3 people · first shared 2017
- 13Contributing to Servo2 people · 79 points · first shared 2015 · 7 comments on HN
- 14Phantom Types in Rust2 people · 75 points · first shared 2013 · 18 comments on HN
- 15Revisiting Alice ML2 people · 47 points · first shared 2014 · 1 comments on HN
What HN people wrote when they linked it
igouy · 2022-08-11
> you saved your work by snapshotting the entire VM state
That doesn't seem likely, that wasn't the recommended approach to managing source code in Smalltalk — but I have no personal experience with Self.
Seems like it might depend on which version of Self is being discussed.
"To briefly recap, the Self transporter allows the programmer to take a program that adds some functionality to a snapshot and move that program to another snapshot. It accomplishes this task by writing the slots that comprise the program to a source file that can be read in and evaluated in the new snapshot to recreate the program."
https://bluishcoder.co.nz/self/transporter.pdf
eggy · 2021-12-23
Wow, thanks for those links. I am well acquainted with Lisp, but I never stumbled upon these. The video was great too.
I have played with Wasp Lisp which is very cool and the Wasp VM. And checkout how it can spawn drone nodes on different machines[1,2]. I think C and Lisp together are amazing. I have been using them for decades, but J and APL entered my life over 8 years ago, and I am hooked! Checkout a rework of the famous APL GoL demo. It's much easier to understand than the original[3]
[1] https://github.com/swdunlop/WaspVM
[2] https://bluishcoder.co.nz/2015/02/19/spawning-windows-commands-in-wasp…
[3] https://www.youtube.com/watch?v=pMslgySQ8nc
tasty_freeze · 2019-08-31
I have written a single javascript program in my life, and it was an emulator for an 8080-based machine. I used https://bluishcoder.co.nz/js8080/ for that part of the emulator, though I had to make some changes to it.
I found the emulator ran 4x faster on firefox than on chrome. The culprit was the main dispatch loop, a 256-entry switch statement. Chrome used a slow fall-back path because there were too many cases. The fix was to have "if (opcode < 128) { switch for first 128 cases} else { switch for other 128 cases }". It made FF a little bit slower, but greatly sped up on Chrome.
I also tried generating 256 functions and then dispatch to the right sub based on an array of function pointers, but it wasn't any faster than the switch statement.
But that was five year ago, and I'm sure the landscape is different now.
doublec · 2018-10-03
I used Factor a lot in the past. It's a great language. Some blog posts of mine on the subject: https://bluishcoder.co.nz/tags/factor/
And here's a quick screencast I put together that shows using the Factor GUI to drill down objects and source using the Gopher client as an example: https://www.youtube.com/watch?v=sozwQ7QmOhs
PeCaN · 2018-06-07
ATS is an amazing language, but suffers from being mainly a one-person effort.
doublec's ATS articles are probably the most accessible introduction: https://bluishcoder.co.nz/tags/ats/index.html
Other than that the documentation is very decent for a one-man research project. (I say "research project", and it is, but it has huge practical value as well.)
Still, I have very high hopes for ATS.
vram22 · 2017-11-28
Evan writes posts about multiple languages, IIRC. I had seen his blog earlier and read a few posts about other languages.
Another blogger with an interesting blog, who writes about multiple languages, is Chris Double. His blog is https://bluishcoder.co.nz (Bluish Coder is an anagram of his name, IIRC). I recently saw a post on his blog called "Introduction to J." The post also has a short list of links for learning J.
jsoftware.com is the J site.
https://en.wikipedia.org/wiki/J_(programming_language)
J was developed by Kenneth Iverson, creator of APL.
alyandon · 2014-01-30
When I worked my way through SICP I found the following javascript based scheme REPL very useful:
http://bluishcoder.co.nz/jsscheme/
Unfortunately, searching for jsscheme in Google gives you a list of many different projects that either share the same name or have a very similar name.
onethumb · 2013-09-12
So awesome.
Presumably this doesn't yet allow streaming, including scrubbing / resolution & bitrate switching / etc, since Media Source Extensions / MPEG-DASH aren't supported in anything but Chrome?
MSE: https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-sour…
MPEG-DASH: http://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP
Apparently Firefox is getting close, which is heartening: http://bluishcoder.co.nz/2013/08/20/progress-towards-media-source-exte…
If anyone from Kickstarter is here, love to hear if you're starting to play with MSE support for supported browsers, or if you're just doing download-and-play. Congrats either way - so glad to see more of this.
sgornick · 2010-11-15
Get 0.05 bitcoins, for completing a captcha.
http://freebitcoins.appspot.com/
More on Bitcoin:
http://www.bluishcoder.co.nz/2010/10/10/a-short-introduction-to-bitcoi…
http://lwn.net/SubscriberLink/414452/b8bf16adf2d1564a/
panic · 2017-07-25
Here are a bunch of blogs from my RSS reader that I think are worth reading. Some of them haven't updated in a while, but the archives may be worth a look anyway.
* Blogs with a math focus:
http://blog.sigfpe.com
http://bit-player.org
http://mathr.co.uk/blog/
https://www.johndcook.com/blog/
* Blogs with a programming languages focus:
https://existentialtype.wordpress.com
https://bluishcoder.co.nz
http://blog.ezyang.com
http://akkartik.name
http://lambda-the-ultimate.org
http://mrale.ph
* Blogs with a UI design focus:
http://www.brandonwalkin.com/blog/
http://ignorethecode.net/blog/
http://interuserface.net
* Blogs with a graphics / 3D rendering focus:
http://c0de517e.blogspot.com
http://diaryofagraphicsprogrammer.blogspot.com
https://directtovideo.wordpress.com
http://graphicrants.blogspot.com
http://www.reedbeta.com
http://www.realtimerendering.com/blog/
https://blog.demofox.org
http://eelpi.gotdns.org/blog.wiki.html
* Other interesting / more general programming blogs (many of these have a "systems" focus):
http://danluu.com
http://ewontfix.com
http://chneukirchen.org/blog/
http://neverworkintheory.org
http://apenwarr.ca/log/
https://www.snellman.net/blog/
https://www.pvk.ca
http://psy-lob-saw.blogspot.com
https://randomascii.wordpress.com
http://fastcompression.blogspot.com
https://fgiesen.wordpress.com
http://blog.plover.com
http://chneukirchen.org/trivium/
http://rachelbythebay.com/w/
akkartik · 2013-01-10
I see. Yeah, I stand corrected.
I was conflating continuation-based and closure-based webservers because both allow straight-line code instead of explicitly managing url handlers.
And the traditional rhetoric in favor of this technique has come from Seaside, which popularized the name 'continuation-based' (http://www.linux-mag.com/id/7424; http://www.bluishcoder.co.nz/2006/05/server-side-javascript.html)
I'd never seen anybody say this is just an early-prototyping technique. But searching found Patrick Collison concur: http://www.quora.com/Whats-the-best-continuation-based-web-framework
It was too harsh to say it paints us into a corner; it is possible to replace fnid links with new defops. I went back and looked at the frontpage when not logged-in, and saw that there are 0 fnid links in that common case. (One possible way to gradually use a second server would be to just serve the frontpage off it. You'd need to move to a centralized store for user/profile/story objects, but the fnids table could continue to live on one server.)
It also turns out that there's at least one company trying to scale continuation-based servers (http://bc.tech.coop/blog/040404.html). So it was overly harsh to call it a dead end.
vtail · 2012-01-06
You are doing yourself a great service by learning Scheme - that can fundamentally change how you think about programming. Reading the first chapter of SICP[0] will change you forever. Yet right now you're using Scheme as a Python/C/Ruby with a strange syntax, while it's a totally different language with its own idioms. You should learn them to master Scheme.
As for your particular questions:
1. map yields an error under mzscheme
I'm at work, and didn't have access to a proper scheme, so I used an online REPL[1], which apparently is more forgiving. Regardless, you can write your own map (a good exercise!) that stops as soon as one of the arguments is exhausted. Make it tail-recursive[2] as well!
2. list-ref is bad
Lists are beautiful data structures designed for recursive algorithms. If you are using lists and not using recursion (or a hidden recursion in the form of map), you're doing something wrong. list-ref uses list as a vector, which has a performance implications - your algorithm is O(n^3) while mine is O(n^2).
3. set! is bad
Margins are too small for a proper explanation :), but basically set! has side-effects[3], and functional programming should avoid having them.
Have fun learning Scheme!
[0] http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-9.html#%_chap_1
[1] http://www.bluishcoder.co.nz/jsscheme/
[2] http://en.wikipedia.org/wiki/Tail_call
[3] http://en.wikipedia.org/wiki/Side_effect_(computer_science)
BlanketLogic · 2025-07-29
It is based on actors and "reference capabilities". These two blogs[1,2], could provide nice introduction.
1. https://blog.jtfmumm.com//2016/03/06/safely-sharing-data-pony-referenc… 2. https://bluishcoder.co.nz/2017/07/31/reference_capabilities_consume_re…
trealira · 2023-12-21
I think you can do this with proof assistants, and with the SPARK version of Ada.
You can also do it with a dependent type system. I haven't used it, but from what I've read, in the ATS programming language, which is dependently typed, you can guarantee that array index accesses and pointer arithmetic never goes out of bounds, at the cost of having to pass proof variables explicitly to various functions.
This poster goes over how to ensure you don't cause buffer overflows in it:
https://bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-s…
https://bluishcoder.co.nz/2018/01/10/capturing-program-invariants-in-a…
It's a bit obscure; this is the only person who's ever blogged about ATS, as far as I can tell.
rileyphone · 2022-11-09
It may help to know that Smalltalk and Java were implemented on top of Self in one of the last projects done with it; the Smalltalk implementation was faster than some of the main commercial ones.
https://bluishcoder.co.nz/self/substrate.pdf
dharmatech · 2022-07-24
Chris Double's posts on Factor:
https://bluishcoder.co.nz/tags/factor/index.html
bleachedsleet · 2021-09-19
Freenet can be run through Tor using Onioncat as a virtual network. [0]
[0] https://bluishcoder.co.nz/2016/08/18/using-freenet-over-tor.html
zem · 2020-11-17
very little i could find, sadly. chris double has a few nice blog posts from when he was exploring the language: https://bluishcoder.co.nz/tags/pure/index.html
ghostwriter · 2020-08-12
Hey, no worries!
Personally I think this playlist provides a nice set of real-world examples implemented in ATS:
https://www.youtube.com/watch?v=dsILVOqYCU0&list=PL6BIXG1a4elukfR7…
And this series of blogposts is a pure gold:
https://bluishcoder.co.nz/tags/ats/
And here's the official language introductory resources:
Language Tutorial - http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/INT2PROGIN…
Language Features Overview - http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/ATS2TUTORIA…
snaky · 2018-09-24
If you are interesting in a programming language suitable for system level programming, and using proving techniques, maybe ATS would be of interest.
https://www.youtube.com/watch?v=zt0OQb1DBko
https://bluishcoder.co.nz/tags/ats/index.html
DougBTX · 2018-01-18
Yes you can, if your programming language supports dependent types: https://bluishcoder.co.nz/2013/05/07/ranged-integer-types-and-bounds-c…
mrsteveman1 · 2017-08-14
> language that is as similar to Python as possible without requiring a global lock
Something like Pony[0] or Nim[1]? I'm not very familiar with either one, but Nim says it is inspired by Python, and on the surface Pony appears to be as well.
[0] https://bluishcoder.co.nz/2015/11/04/a-quick-look-at-pony.html
[1] https://nim-lang.org/features.html
shakna · 2017-05-10
> Yes, I understand. Though I don't want to divert too much from scheme standard. The end goal is to run everything using GNU Guile.
jsScheme might be able to give you a good halfway. [0]
It's a JIT-capable, and mostly R5RS compatible, and works from IE6 and up.
[0] https://bluishcoder.co.nz/jsscheme/
patrec · 2016-12-05
There are at least functional programming languages that try to let you get by without or at least less GC:
ATS: https://bluishcoder.co.nz/2011/02/27/linear-datatypes-in-ats.html
Stalin does global static life time analysis and MLKit uses GC only to augment it's region based scheme, but you can turn it off (at the cost of guaranteed space safety).
Of course Rust is a bastard child of ML as well.
pikzen · 2015-05-01
OP is referring to http://bluishcoder.co.nz/2015/03/24/contributing-to-servo.html
typish · 2015-04-29
This is something Plan 9 or Inferno (http://inferno-os.org/) would give you. You can run the main OS someone and mount the resources on other devices - including display, net and CPU resources. An example of doing this with a phone is here: http://bluishcoder.co.nz/2012/11/07/sharing-computer-and-phone-resourc…
Inferno is a portable and can be run on host operating systems. It would be possible to build it as an app on Windows Phone, Android, etc to access your Inferno resources on other devices.
carloscm · 2014-10-27
This reminded me of ATS - http://www.ats-lang.org/
Check also Chris Double blog - http://bluishcoder.co.nz/tags/ats/
ATS combines ML-style types, linear types, dependent types and theorem-proving. Plus it compiles down to C, has pointers including (safe!) pointer arithmetic, has trivial C interop, and doesn't have GC (alloc/free safety is provided by the linear types, like with Rust lifetimes). It's a really interesting beast and I hope I have more time in the future to dive into it. Idris wins in the syntax department tho.
steveklabnik · 2014-04-21
You can even take this a step further: using `float` instead of `kilogram` is leaking an implementation detail. It's (probably) too low-level of information to actually be useful.
Luckily, more and more programming languages are making creating these simple types easier. Haskell:
newtype Kilogram = Integer
Rust:
struct Kilogram(int);
In fact, this blog post, while a bit outdated, shows an application of this idea, to solve string encoding issues for HTML templating: http://bluishcoder.co.nz/2013/08/15/phantom_types_in_rust.html
cpeterso · 2014-04-11
This blog post demonstrates how OpenSSL's unsafe C code can be migrated to a safe programming language called ATS (Applied Type System):
http://bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-sa…