Better HN
topnewbestaskshowjobs
Log inSign up

FullyFunctional

3,566 karma · joined May 8, 2013 (13y ago) · 1,534 submissions

Submissions

comment 11y ago · link · parent

Actually, the CP/M version was called COMPAS Pascal, but it was very nearly the same code.

comment 11y ago · link · parent

Huh, how does that follow? This was clearly a case of terrible planning and disastrous intervention. That doesn't mean that all planning and all intervention is bad.

Frankly, no planning is bad planning.

comment 11y ago · link · parent

Nothing wild about that. Implementations using frame pointers effectively have exactly that and in some architectures, like SPARC, this is mandatory. Furthermore, some functional languages (SML and some Scheme implementations) do this explicitly. For one this, it make call-with-current-continuation much simpler to implement.

comment 11y ago · link · parent

Oops, that static activation records would probably not work with the Algol 60 parameter semantics so the original point stands: supporting recursion is really expensive on that breed of hardware.

comment 11y ago · link · parent

This is a well known story. I do take issue with the arrogance of the author: "Of course we cannot blame the Bauer faction for not having the experience of later workers in the field."

Oh _please_! The reality was the the common machines of the time didn't have todays fancy addressing modes. All memory addresses were global addresses. Thus, the _cost_ of making all memory access relative to a stack pointer was far from trivial. Of course, there was a work-around if you could forgo re-entrance (~ "thread-safety"): use static activation records, but saving it to the stack before the recursive call and restoring after. Still not exactly free.

comment 11y ago · link · parent

This would have been nearly perfect for me if it had supported disconnected operation with later synchronization (~ Dropbox, CODA, ..). Alas, it's a live fs. (Dropbox is great except it doesn't encrypt locally and has to have a local copy of everything, unlike a cache).

comment 11y ago · link · parent

This is very well written. I want to mention two other IL that takes SSA even closer to a functional representation: thinned gated single-assignment (TGSA) form and the Value Dependence Graph.

I've used the former with pleasure as a lot of traditional passes become trivially done by construction: global common subexpression elimination, copy propagation, dead code elimination, and constant propagation. With very little extra work you also get strength reduction, expression hoisting, and a host of other things that I'm forgetting.

I never understood why this wasn't more popular as old-school SSA, as used by even LLVM, is so terribly clunky and inefficient.

comment 11y ago · link · parent

In the US perhaps, not in Europe

comment 11y ago · link · parent

Maybe Microsoft should make it painlessly easy instead?

I depend on Waze every day and its issues are nothing compared to value it provides. Unfortunately it's not integrated into my Model S so sometimes I drive with both the "native" Model S GPS (= Google Maps) and Waze so I can benefit from the greater maps on the 17" screen as well as the better directions from Waze. It's mighty confusing though.

comment 11y ago · link · parent

Troll? ECC is only going to become more important as memory sizes grow. 256 GB isn't rare in a multi socket server and I cannot phantom that without ECC.

comment 11y ago · link · parent

Even though the integer type is unbounded, in practice the vast majority of runtime values are small, thus we can implement them efficiently using tagged pointers [small values are completely contained in the pointer]. LISP and Smalltalk have been doing this since the 70'es. Sun SPARC even _had_ hardware support for doing it with no (zero) overhead, see tagged instructions (https://en.wikipedia.org/wiki/SPARC). Even on x86, it's not that bad; the overhead for the general case is two tag extractions and three predicable (not-taken) branches (we must check for overflow), about five additional instructions. Not zero, but the dynamic frequency of these is much lower in a high-level language than in, say, C.

The performance differences between Erlang and Haskell (etc) are due to many reasons, but primarily due to Erlang being a dynamic PL, with late binding and dynamic typing. This makes efficient implementation hard (heroic efforts on JavaScript not withstanding), but Erlang makes no excuses as its strengths lies elsewhere. If you need fast compute you should do it in C and interface it with Erlang (lots of ways to do that).

comment 11y ago · link · parent

I've known and loved Haskell for more than a decade so when I was "encouraged" to learn Erlang it expected to hate it. I was thoroughly surprised to see how nice it is. As for the syntax, I mostly find it great (but obviously different).

Something I find worth emphasizing: There is exactly one integer type and integers are unbounded. Very few languages gets this right and it's IMO one of the worst mistakes in Haskell. This takes care of a whole slew of bugs and security pitfalls.

I'm still an Erlang n00b, but the lack of a native string type seems a major weakness -- strings are isomorphic to a list of small integers, worse than even Haskell. Please give us something based on Ropes, like in Cedar (http://onlinelibrary.wiley.com/doi/10.1002/spe.4380251203/ab...). EDIT: typo.

comment 11y ago · link · parent

Congratulations on the First and thanks for the polished package - this is quite impressive.

I finally cracked open the iCE40 HX datasheet, but was stunned to see the memory block: "Note the sysMEM Embedded Block RAM Memory address 0 cannot be initialized." That's extremely awkward.

comment 11y ago · link · parent

tame(2) seems really ad-hoc. Also, isn't the path checking, like

  strncmp(path, "/tmp/", 5) == 0) {
trivially bypassable with a something like /tmp/../usr/bin ?

comment 11y ago · link · parent

The "funniness" is probably subjective. This type of code rant aren't exactly rare. However, these particular complaints about BSD sockets are common and IMO fully deserved. That design isn't exactly brilliant. Another insightful critique (by DJB): http://cr.yp.to/tcpip/twofd.html

comment 11y ago · link · parent

I have the misfortune of having encrypted some files in the past with PGP. At the time, the default algorithm appeared to be IDEA which was removed since for patent reasons. Find the old sources and getting it to built is not trivial.

These days I'm leaning towards bundling encrypted files along with the C code that encrypted it and that works better if the latter is small and self-contained.

comment 11y ago · link · parent

Wow, that is pretty awesome. I didn't expect this to have arrived that quickly.

Does it support user constraints on relative placement (and routing)? Self-timed logic, such as NULL Convention Logic [1], doesn't fit well with the synchronous FPGA paradigm, but can be implement on those if the feedback loops are tightly controlled [2]. I'd like to play with that :)

[1] http://en.wikipedia.org/wiki/Asynchronous_circuit

    http://www.amazon.com/Designing-Asynchronous-Circuits-Convention-Synthesis/dp/1598299816
[2] http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=543867...

comment 11y ago · link · parent

Nope, you are including the IP header. The UDP head has: port.

comment 11y ago · link · parent

Great writeup. Perhaps slightly less clean, you could cut the messages in half by having the available report the result as well (empty in the initial case).

Is the worker idling between replying and receiving new work? In other words, does ZMQ enable overlapping, say always having two outstanding requests per worker?

comment 11y ago · link · parent

There isn't consensus that Lisp, Scheme, ML, and O'Caml are functional. Period. There certainly is consensus everywhere that they aren't purely functional. Purely functional doesn't require nor implies lazy, but the two tends to go together for good reasons.

"Functional programming is a style that can be used in any language"

No, I'm sorry, it's not. [Purely] Functional programming provides guarantees and properties that are only valid if the necessary discipline is enforced. Your list of languages are merely procedural languages with functions.

comment 11y ago · link · parent

My takeaway from this is that the author clearly documented the AL1 as the worlds first microprocessor. The arguments against are artificial; it doesn't matter that this wasn't the intended configuration nor that one essentially had to program it in microcode. The microcode ROM is nothing more than a compression technology which doesn't render it a more capable.

All that said, it's all arbitrary and the 4004 is the first _successful_ microprocessor. (I personally find it a more interesting question which alternative architectures could have been produced given the technology and constraints of the 4004 and 8080).

comment 11y ago · link · parent

Reduceron, which I try to maintain, is written in York Lava. It has a module for writing sequential logic (called Recipe) and while it makes sequential logic way easier, I have been working on an alternative for a while.

I completely agree that the sequential parts of a design is the challenging (= bug prone) part and IMO this is the area where an EDSL like Lava can really shine.

If you have worked in ASIC designs that you are almost certainly used to not work with Verilog directly, but with an ad-hoc macro language. I've seen them all, but most commonly Perl is used. It is especially for circuits that we desperately need better tools and abstractions.

When designing with Lava you aren't describing a circuit, but a the method to create that circuit. That makes it relatively trivial to completely parametrize it or statically check properties of the circuit.

As an example, if done right (Recipe isn't), adding a pipeline stage can be a matter of adding a single line. Compare that to what it takes in say Verilog.

This style of ASIC development is simply incomparable to the primitive Verilog-style, but there's not enough experience in the industry to understand it [yet].

Now, Clash isn't (IIUC) an EDSL like Lava so without knowing more about it, I fear it looses much of the point.

EDIT: formatting

comment 11y ago · link · parent

Interesting, thanks, but those are 2013 numbers. The article claims California grew/is growing faster than Texas which isn't the case in your linked report, so I wonder where one might find more recent data.

comment 11y ago · link · parent

Very very cool. I look forward to the first baby steps in the opposite direction (P&R).

comment 11y ago · link · parent

(I preordered one myself).

No, I don't think that's accurate. Things had gone bad long before that, but it wasn't obvious right away that the ship was sinking. That said, going stealth didn't help them one iota but caused a lot of ire.

My experience with ~ 25 KS has been mixed. ~ 4 failed to deliver, more than half delivered successfully. A couple delivered a lousy product. ~ 1/3 are still pending. Almost all of them are late or very very late, especially SW projects seems to drag on forever.

My appetite for KS has cooled a lot and frankly I'm surprised my experience hasn't been worse.

comment 11y ago · link · parent

I can promise you wouldn't once you've tried going beyond the simplest possible single issue pipeline. Thankfully branch prediction made them sort of pointless. RISC-V and Alpha are two of the better RISCs ISAs in this world and they don't have them. Read the RISC-V ISA footnotes [1] for excellent design decisions rationales.

[1] http://riscv.org/download.html#tab_isaspec

comment 11y ago · link · parent

SOAR, not SPURS.

* The window overflow and underflow are complicated to handle correctly for the OS.

* The fixed window size means a tax for deeply recursive functions that doesn't need the 16 registers.

comment 11y ago · link · parent

Oh where to start.

* Primarily, compiler technology leap frogged it to where you can do at _least_ as well with a fixed set of registers and a global allocator.

* The windows were inspired by SPURS (IIRC), where it allowed a much finer granularity whereas SPARC's window is always exactly 16 registers (8 are global, and 8 overlap with the next or previous window).

* Windows turned out to be a real PITA for super scalar implementation.

* Windows assume a constrained model of computation and makes efficient tail recursion hard and co-routines impossible.

etc etc

Give me more time and I could make the list longer, but the crux is that it's another example of a misguided shorted sighted optimization (like branch delay slots, shared with many RISCs).

comment 11y ago · link · parent

What I found is that I'm the same person, but having children changed my perspective. I'm more conscious of how I spend my time so I hopefully waste less and still have time for both my family and myself.
1
4849505152