Showing posts from April, 2016

On the desirable properties of a programming language

For the past 15 years, I've wanted to create a programming language. It is easy enough to do so, if one just wants to create something. But I've wanted to create something that improves in some substantial way on what already exists, and stands the test of time.

10 years ago, I created Flow. Flow is not widely known, but it's the asynchronous architecture that underpins Bitvise SSH Server and SSH Client. It's a message-passing architecture based on small, Erlang-like processes, implemented using fibers in C++. One of the main purposes of Flow was to make it easier to reason about a complex, asynchronous application, and I do believe it succeeded to an extent. Its grander motivation was to make it trivial to write complex applications that scale effortlessly to any number of parallel processors.

I believe that Flow would meet this second goal, but its ability to do so is yet untested. We do not actually need the type of scaling Flow would provide in our software. We use…

"Hello world" in LLVM IR language without CRT

The LLVM Language Reference Manual has a "Hello world" example that uses the C run-time library.

I wanted a bare-bones example, using only the Win32 API, without a CRT dependency. Here it is:
  @.str = private unnamed_addr constant [13 x i8] c"Hello world\0A\00" declare i64 @GetStdHandle(i32) nounwind declare i32 @WriteFile(i64, i8* nocapture, i32, i32* nocapture, i8*) nounwind define i32 @Entry() { %hwStr = getelementptr [13 x i8]* @.str, i64 0, i64 0 %handle = call i64 @GetStdHandle(i32 -11) %bytes = alloca i32 call i32 @WriteFile(i64 %handle, i8* %hwStr, i32 12, i32* %bytes, i8* null) ret i32 2 }Compile and link steps:
  llc -filetype=obj hw.ll link hw.obj kernel32.lib /entry:Entry /subsystem:consoleThe resulting executable has 2,560 bytes, prints "Hello world", and returns exit code 2.

My main observation is that the language is clumsy. It's meant to be read by humans, but in most cases, generated automatically:
No syn…

Over-education and free college

I agree with most of Sanders' policies, much more than any other candidate. However, I cringe somewhat about his views on education, which seem only kinda half right. Sanders wants to give everyone free access to college, which would be better than what we have now. But...

What he doesn't say (or realize?) is – over-education should be discouraged, because it's competition for a positional good. Hanson and Caplan have had a good conversation about this over the years.

Compared to early employment, college is ineffective at conveying useful skills. It's a competition between individuals about who's going to be "better educated". In this competition, the nation can't do better as a whole by throwing more resources into it. You just get a lot of college graduates who then make for reluctant baristas, many having to settle for something "below" their degree.

The current college loans are unambiguously bad. They drive up the cost of participating…