HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
From Haskell to Hardware

begriffs.com · 125 HN points · 0 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention begriffs.com's video "From Haskell to Hardware".
Watch on begriffs.com [↗]
begriffs.com Summary
Conal Elliott uses a reformulated interpretation of lambda calculus to transform Haskell programs into highly parallelized circuits.
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Jun 28, 2015 · 125 points, 21 comments · submitted by begriffs
snaky
There's a good set of slides by Conal about the project

https://github.com/conal/talk-2015-haskell-to-hardware

eatonphil
Did not watch the video, is this about Bluespec?
None
None
tinco
No, and it isn't about Clash either. It's a system they designed for a now defunct hardware startup called 'Tabula'.

Apparently the technology was some sort of space-tech FPGA that could reconfigure at 2Ghz (i.e. close to the general max clock speed), they use Haskell's typesystem and non-sequentiality to build these circuits in a nice parallel way.

listic
Sounds very rad. I wonder why they closed and what they managed to accomplish?
mng2
The comments on this EETimes article[0] are snarky but the criticisms sound cogent to me.

0: http://www.eetimes.com/document.asp?doc_id=1325499

DevPad
This posting convinced me to learn Haskell. But it requires to be more than just a programmer.

Why I love Python, - because of scientific-friendly community.

Haskell is more than that: more algos, data structures, functional programming, math, - completely next level.

SixSigma
Wirth told us in 1976 that :

Algorithms + Data Stuctures = Programs

https://en.wikipedia.org/wiki/Algorithms_%2B_Data_Structures...

vezzy-fnord
Not sure what "more algos", "data structures" and "math" are supposed to mean here.
jimmaswell
They're just different paradigms, one's not on a "higher" or "lower" level. They're good for different things.
DevPad
Yeah, what I feel like it could be with Haskell: get a glass of good wine and solve interesting programming problem during evening.

And write some beautiful code.

Kenji
Be prepared to be much less productive in Haskell; you can't just get into it and start writing code. Everything must be well thought out before you start to write a line (and yes, that's how it's supposed to be but sometimes it's easier to just hack something together to see what issues might arise, and then make it beautiful). On the other hand, the beauty of Haskell is that the code is much cleaner and modular. Don't be fooled, though: Even in Haskell you can write very ugly code.
dllthomas
"Be prepared to be much less productive in Haskell[.]"

Likely to be the case, but mostly because there's a lot to learn before you can be effective as an intermediate or senior level Haskeller.

"[Y]ou can't just get into it and start writing code. Everything must be well thought out before you start to write a line (and yes, that's how it's supposed to be but sometimes it's easier to just hack something together to see what issues might arise, and then make it beautiful)."

This is not the case at all. You can write Haskell that way, but remember that 1) with type inference, you don't need to specify the types of most things up front; and 2) you can change your types as you go. You can totally just start coding, and then later peel out this tuple into a named type and such. I find I'm most productive somewhere between the two extremes - start from the few types that I know must be fixed (by the fact that I'm interfacing with other code expecting them), then continue sketching in both types and code and let each guide the other.

"On the other hand, the beauty of Haskell is that the code is much cleaner and modular."

When you're doing it right, absolutely.

"Don't be fooled, though: Even in Haskell you can write very ugly code."

Also very much the case - I've done it!

merijnv
> "Don't be fooled, though: Even in Haskell you can write very ugly code."

> Also very much the case - I've done it!

On the bright side, refactoring ugly code into not ugly code is substantially easier in Haskell than many other languages! ;)

dllthomas
It can be. It depends on the reasons your code is ugly. Meaningful refactors are much easier in Haskell. Small, local improvements in clarity aren't going to be substantially different between Haskell and other languages.

Also, it's worth noting that Haskell has a couple ways it can get ugly that are less of an issue in other languages.

First, point-free programming can be incredibly clear when you've got a simple series of transformations of relatively simple data. Sometimes it winds up over-applied, in situations where it would be clearer to break things apart.

Second, most languages enforce a distinction between expression and statement. That Haskell doesn't gives more flexibility about how one breaks up expressions. This flexibility means that sometimes ideas can be expressed more clearly, but it's an additional thing to learn on the path to writing readable Haskell.

psibi
> Everything must be well thought out before you start to write a line

Not exactly. When you are initially learning the language, you have to think a little more. But once you are comfortable with it, the type signatures dictate you what to do. Also, it's quite easy to refactor to a different design because of the types.

codygman
> Be prepared to be much less productive in Haskell; you can't just get into it and start writing code. Everything must be well thought out before you start to write a line

Something about Haskell makes people enforce this upon themselves. You most certainly can hack things together quickly with Haskell after learning as much as you would in an imperative langauge so long as you can accept it will be ugly and unmaintainable, but that's not much different than other languages.

tome
Yeah, I don't recognise that restriction either.
agumonkey
Should we read 'much less productive' as 'much more precise and solid, less buggy and forcede to be well thought through' ? Sometimes it feels that many systems confounds shipping lines with productivity.
DevPad
Very true. It's possible to write ugly code in any programming language, just so easy.
creichert
Be prepared to be much less productive in Haskell; you can't just get into it and start writing code. Everything must be well thought out before you start to write a line

This is only true when you are becoming familiar with the language (arguably any programming language). Once you're able to get a grasp on how to program in Haskell, it's very possible to hack programs together quickly and refactor with confidence later.

agumonkey
I didn't even realized it was Conal Elliott. You're all invited (one at a time) to visit his blog and enjoy the ride. http://conal.net/blog/

Especially if you're into Functional Reactive Programming, rendering, etc, ...

His [re]definition of 3d rendering was gold: http://conal.net/blog/posts/3d-rendering-as-functional-react...

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.