HNHacker News
TopNewBestAskShowJobs

sgeisenh

413 karma · joined February 4, 2014

submissionscomments
sgeisenh··on Starting a tech startup with C++
I don't think it is sad. You explained why it is necessary, C++ has been around for a while, is/was great but there are now languages that can compete in terms of performance with fewer drawbacks in terms of security and undefined behavior.

If you're starting from scratch, it is important to strongly consider which language and platform best suits your needs. Anecdotally, a lot of companies have found success using newer languages because they tend to attract a better proportion of talented people.

sgeisenh··on Is Sound Gradual Typing Dead? [pdf]
Formally, everything has to be effect free; furthermore, everything has to be strict (the potential for any value to be "bottom" breaks things).

You can apply the same intuition and things mostly work, but there can be a few surprises.

These theorems are a huge part of the "if it compiles it must be correct" feeling that functional programming often provides.

sgeisenh··on Is Sound Gradual Typing Dead? [pdf]
There is plenty of work in PL that covers why type theory is useful. Check out the classic paper by Philip Wadler called "Theorems for free" that covers some of the terrific benefits of parametric polymorphism.

There has also been a good amount of discussion generated by organizations such as Jane Street concerning the benefits of static typing and type inference in practice. Notably, the free documentation (that is completely coupled with the code) that you get when you design software that takes advantage of the type system.

sgeisenh··on How Being Named the 'Best New Restaurant in America' Hurt My Business
I don't want to weigh in on the discussion about The Phantom Menace, but I do want to address the sentiment that in order to have a valid opinion about some craft, you have to be proficient at that craft.

When you practice something, you usually don't practice it in order to impress others who practice the same thing. Unfortunately, this ends up happening in many cases (usually with abstract things such as pure mathematics or classical music, where appreciation is difficult without context). But in most cases, you produce things that can be appreciated by others, regardless of their interest in the process. If you knit your friend or loved one a cool scarf, they don't necessarily need to be interested in knitting to enjoy wearing it. And if you're a great baker, someone doesn't need to know anything about baking to enjoy your creations.

All the same, ordinary people can have valid negative opinions of things that they aren't proficient in. When a scarf has numerous dropped stitches or a pie doesn't taste quite right, many people can make observations and express their distaste. Just because they aren't knitters or bakers doesn't mean that their critique doesn't "count for anything." They might not be able to pinpoint the part of the process where something went wrong, but that still doesn't invalidate their opinion.

In this case, the intended audience of The Phantom Menace was not film makers, it was ordinary people (in contrast to say Birdman, which may be easier to appreciate if you have some insight into the dramatic world). Maybe it was meant to appeal to a younger crowd (I enjoyed it when I first saw it). Maybe it was meant to appeal to fans of the original trilogy. But the fact remains that aaronbrethorst is entitled to his opinion and his opinion is perfectly valid.

P.S. I also don't like The Phantom Menace, but that doesn't really matter.

sgeisenh··on How I wrote a self-hosting C compiler in 40 days
I'll just add this on: https://www.cs.cmu.edu/~fp/courses/15411-f14/schedule.html

The lecture notes are simple and excellent, though at a very high level of abstraction. Though most of the notes are full of references to the original material, which is super nice.

sgeisenh··on Harold V. McIntosh and his students: Lisp escapes MIT (2012)
At first I thought this was the name of a court case concerning intellectual property.

Was a nice read. Thanks for posting!

sgeisenh··on Eclipse Code Recommenders
Most academic languages don't have large numbers of stack overflow answers. Look at Standard ML or most dependently typed languages (Agda, Coq, Twelf, etc.). Though, Agda produces snippets for you with hole based programming and there are entire books written about generating snippets with tactics in Coq; as far as Twelf and others are concerned, well, you're on your own.
sgeisenh··on Learn to Code, It's Harder Than You Think
In my opinion, it is very easy to teach the basic principles of software development and design. Algorithmic thinking is much harder to teach. A CS background sets you up to contribute ideas and produce efficient solutions to challenging problems. A software development background sets you up to implement ideas and solve problems quickly.

Obviously these are generalizations, but that's what I have seen in my experience.

sgeisenh··on Compile OCaml to JavaScript, Run on Node
Once you've experienced the joys of parametricity, you can never go back!
sgeisenh··on The Implementation of Functional Programming Languages (1987)
Yes, you can always convert direct style code to continuation passing style code. And continuation passing only uses tail calls. This is one of the big advantages of CPS. Of course if you don't have a tail call optimization, then you overflow the stack pretty quick.
sgeisenh··on Covariance and Contravariance
The example is actually wrong. Functions are contravariant on their input and covariant on their output.

The basic premise behind subtypes is that an object of a subtype can be used anywhere that an object of its supertype can be used. Just as an example, if you replace f1 : Animal -> Animal with f2 : Cat -> Thing, there might be some animals that aren't cats, so f2 can't replace f1 everywhere. This is the reason that functions are contravariant on their input.

sgeisenh··on Show HN: CV Boilerplate – Easing the Process of Building a CV Using LaTeX
Honestly, that's what makes LaTeX great. Formatting is decoupled from content. If you want to make a formatting change, you can Google it and chances are that somebody else has done the same thing.
sgeisenh··on The Black Hole of Software Engineering Research
It really isn't narrow. Mathematics, philosophy and computer science are just three different ways of viewing the same problems.
sgeisenh··on A Path to Enlightenment in Programming Language Theory
The commonplace languages in use are difficult to reason about. It would take a serious paradigm shift for most companies to stop what they're doing and develop a tool chain for wholesale program verification. Additionally, it takes a special breed of programmer to be able and willing to write code in such a way that enables verification, then actually take the time to verify it. Functional programming is a jump for most main stream engineers, it is an altogether different matter to recruit or develop a team of engineers familiar with dependent type theory and formal verification.

The industry tends to lag behind academia by at least a couple decades. In the 90's, lots of research was being devoted to functional programming and the various applications of type systems. Now we see various companies starting to use languages like Haskell and ocaml. Nowadays, it seems like dependent types and program verification are popular in academia, so maybe we'll see some of that by 2030.

sgeisenh··on A Path to Enlightenment in Programming Language Theory
Check out compcert for a verified c compiler. And several Haskell projects have been verified.
sgeisenh··on Google: 90% of our engineers use the software you wrote (Homebrew), but...
If you instead use a language with algebraic datatypes, you can get a nice concise implementation. Let's try OCaml:

  type 'a tree =
    | Node of 'a tree * 'a * 'a tree
    | Leaf
  
  let rec reverse = function
    | Node (L, x, R) -> Node (reverse R, x, reverse L)
    | Leaf           -> Leaf
  
Isn't that nice? And it is even easy to reason about! Unfortunately, OCaml tends to chew up stack space so we're likely to seg fault, but that's okay!
sgeisenh··on Google: 90% of our engineers use the software you wrote (Homebrew), but...
What material did you spend time on that you don't know how to reverse a binary tree?

It isn't a difficult problem, even having never seen it before. This is one of those warmup problems to test how comfortable a candidate is with basic concepts such as recursion.

sgeisenh··on If Haskell were strict, what would the laziness be like?
It is in an actual language! It's called ML! And modules are better for abstraction than type classes.
sgeisenh··on OCaml 4.03 will, “if all goes well”, support multicore
Just about every eagerly evaluated functional language supports laziness through thunks. This is just syntactic sugar.
sgeisenh··on Ela, dynamic functional language
Ela is a type safe, strictly typed language, which is, however, not burden by limitations of any particular type checker.

By nature, a language which is type safe and strictly typed must be burdened by the limitations of a "particular type checker." This is weak type safety at best. And it looks like there are runtime class checks, so you have all of the traditional drawbacks of dynamic languages.

sgeisenh··on Where to Go to College If You Want a High-Paying Job
This is Simpson's paradox at work. And the article even acknowledges it. Most of the universities on the list have disproportionate numbers of students in STEM fields.

That's why Ivy League schools aren't well represented. And also why places like CMU or University of California don't appear. Additionally, salaries aren't adjusted for cost of living. Most of the universities here are located in areas with a high cost of living, so salaries will typically be higher.

sgeisenh··on Take me as an Intern – 19yo student seeking internship
A lot of interviewers like to ensure that you're comfortable with pointers and the distinction between the stack and the heap. It can be nice to list a familiarity on your resume just to let people know that you're comfortable with those kinds of questions.
sgeisenh··on Why OCaml, why now? (2014)
> I'll mention, though, that Haskell does have one form of modularity which ML doesn't really, which is the fact that you can write algorithms separately, compose them together after the fact, and expect to get reasonable performance in most cases.

I'd actually argue the opposite. MLton is one of the best whole program optimizing compilers I have ever used. There are virtually no penalties for abstraction. OCaml has a bit of trouble here, from what I've heard, but I've never personally run into serious performance problems as a result of abstraction.

sgeisenh··on Why switching jobs is almost always a good idea
If somebody joins your company and finds that it isn't a good fit, isn't it preferable for both parties that they leave?

When an employee isn't motivated, both the employee and employer lose.

sgeisenh··on Comparing OCaml and Standard ML
Purity is almost used in a pejorative sense throughout the page.

If it wasn't for poor library support, I would prefer using SML to OCaml. SML is syntactically simpler and both SML/NJ and MLton have a lot to offer that I haven't yet found with OCaml.

I think one of the biggest mistakes in the life cycle of SML was premature specification. As a result of the language definition, SML has stagnated for almost 20 years. There is now some notion of "Successor ML" (see: http://sml-family.org/), but I honestly don't see it catching on outside of an academic space.

As an academic language, SML is great. It is a great tool for learning functional programming since the learning curve isn't especially steep. It is easy to reason about performance since evaluation order is explicit. And immutability is the default but with mutable types that are easy to use.

sgeisenh··on The skyline problem
If you think recursively, the n log n divide and conquer solution is pretty straightforward.

The problem becomes much more interesting when you consider optimal parallel performance. The best span you can do is log^2 n. I believe the problem can be reduced to sorting, though it is not required to explicitly sort the sequence of buildings in order to achieve the desired asymptotic performance.

sgeisenh··on Why We Use OCaml
Yeah. The movers and shakers in software are always the big companies. But there are quite a few institutions that feature functional programming in their undergraduate curriculum.

One of the main gripes that people mention with functional languages is that it can be difficult to find developers. Several good universities are pouring out competent programmers.

sgeisenh··on Why We Use OCaml
>I don't understand your response. Are you saying the OCaml community primarily consists of undergraduates?

What I am saying is that a sizable portion of academia uses a variant of ML. Maybe it hasn't caught on in industry, but that doesn't mean that there isn't a community that uses it.

> That right there should tell you something.

A lot of development of core tools for mainstream languages comes from the companies that use them. Clang and LLVM, for example, received support from Intel, Google and Apple just to name a few.

Jane Street has reimplemented much of the OCaml standard library for their own purposes. Facebook has already started implementing tools in Haskell. Once functional languages gain more traction, I suspect that the tools will improve substantially.

sgeisenh··on Why We Use OCaml
But there is a strong community behind OCaml. A lot of undergraduate programs use a dialect of ML for their core classes.

While most OCaml implementations have poor standard libraries, Jane Street Capital has released several open source libraries that make it easy to implement high quality, performant applications.

sgeisenh··on Show HN: Free, anonymous coding interview practice
Yeah, when the lists are sorted, you need the intuition that you can merge two sorted lists in less than n * log n time. Like you say, the best you can do for merging several sorted lists is (sum of lengths) * log(# of lists).
← PreviousPage 4 of 5Next →