Better HN
topnewbestaskshowjobs
Log inSign up

FullyFunctional

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

Submissions

comment 7y ago · link · parent

I thought this was going to be about C++

However, this little language looks a lot like Joy (which I suspect was named ironically).

On a serious note, I'd be more curious to see alternative syntax for Lisp (please, I know about code as data etc). McCarty envisioned M-expressions [1], but I have never seen anyone implement them or even nicer ones.

[1] http://www.softwarepreservation.org/projects/LISP/book/LISP%...

comment 7y ago · link · parent

Hmm, seems a little lacking in references to prior art. However, Prof. Michael Franz used a (subset?) of thinned gated single assignment in his thesis so there's hope. As I keep arguing [1], TGSA is astonishingly under-appreciated.

[1] https://news.ycombinator.com/item?id=10059823

comment 7y ago · link · parent

This is very interesting. Do you have a good example to study how this should be done?

comment 7y ago · link · parent

I did a similar exercise a few years ago [1] and was recently inspired to redo it for RISC-V. It turned out to be so much easier that I even had to energy to improve it to the point where really good code was generated. It was a ton of fun and I’d encourage ppl to try.

[1] https://github.com/tommythorn/expjit3

comment 7y ago · link · parent

Constraint solvers comes to mind. It's pretty much the most memory hungry application I can think of, though some of the VLSA EDA tools need triple digit GBs of memory to do anything.

comment 7y ago · link · parent

I don't have good references handy where I am right now, but Hotchips a couple of years ago had many examples, including a Memcache accelerator.

A more down-to-earth example shipped with an Arrow FPGA dev kit I got: they took a software and ported MPG123 (mp3 decoding). They then profiled it and isolated a candidate for acceleration (some moderately wide integer operation). The result saved meaningful amount of CPU cycles and power. (The FPGA board was battery driven, which is still unusual).

comment 7y ago · link · parent

That's not what RISC means. The fact that it's using a different microarchitecture on the inside doesn't in anyway eliminate the complexity and challenges that comes from the ISA, not least the complexity for the decoder and branch predictors.

What Intel (and IBM's Z9) has demonstrated is that with enough enginering and silicon, you can still make complexity go fast. What RISC (like RISC-V and Aarch64) enables is the same kind of microarchitecture but with far far lower complexity (= time to market, design team, etc). Intel is still doing really well because the physical design (custom cells) is hard and takes teams that are hard to come by.

Things are very interesting right now and for the next few years.

comment 7y ago · link · parent

Actually, I think FPGAs are amazingly cheap compared to what it would cost you to fab a chip of similar specs. A leading-edge FPGA will get you near-leading edge DSPs, memory blocks, SerDes, etc. What you _don't_ get is the frequency of a custom part for the full design (this is the FPGA overhead).

Simple RISC softcores run at 200-400 MHz in modern parts. Couple this with custom softcore accelerators and you can get very performant designs. The biggest issue with deploying FPGAs however is that it's much harder to design for, especially dealing with hard blocks, like memory controllers and PCIe.

comment 7y ago · link · parent

Do you pay to charge?

comment 7y ago · link · parent

All these Tesla competitors ... they are not really competitors unless they offer access to the Super Charger Network or provide something similar. More than anything the Super Charger is a game changer. Even though I very very rarely uses it, it enables the occasional long distance trip, making it practical to own just an EV and not need a 2nd car (or rent one)

comment 7y ago · link · parent

Really interesting. Alas, the "Supplementary Movie 1" appears corrupted for me (tried two devices, two networks).

comment 7y ago · link · parent

I'm in the same category; my EYES just aren't good enough for small phones and I have jumped on every larger iPhone even though I can't completely use everything one handed. I'd even take an even larger phone (~ "small iPad") if I can find a way to hold it. It's a trade-off and we do not all have the same constraints and preferences.

comment 7y ago · link · parent

This has come up so many times. It has far too little memory for Linux, but ignoring that, the MMU is broken and can't support virtual memory (not that they claim to support supervisor mode anywhere).

comment 7y ago · link · parent

To my knowledge, no other _widely deployed_ ISA has had this level of flexibility and foresight. In fact it's usually the opposite; the ISA is usually tightly coupled to the processor implementation that introduced it and the survival (= market success) of the immediate product is all that matters. However if it's successful, the successor(s) are now locked into support all the legacy of its predecessors.

I can only think of two other examples that successfully planned for the future: the IBM 360 (extremely CISC, but still alive today) and the DEC Alpha (beautiful design, but now mostly dead).

comment 7y ago · link · parent

RISC-V is very VERY close to Alpha in this respect. There are no flags, everything is communicated via registers (which makes semantics clean and dynamic scheduling cheaper), and the equivalent of PALcode exist (called platform specific SBI calls, executing in M-mode).

IMhO, RISC-V is slightly better than Alpha on a many fronts: the conditional branches which compares two registers would take two instructions on Alpha (on the critical path), RISC-V code density is better with compressed, the encoding is slightly cheaper for hardware, it ISA is more forward-looking/extensible, oh and it's open of course. The only thing I miss are the POPC/CTZ/CLZ instructions, but the B set will include them for implementations that have it.

UPDATE: more RISC-V upsides

comment 7y ago · link · parent

There is certainly no consensus that it's the preferred style. Some designers prefer this explicit (and more verbose) style but others prefer the less verbose one (with default first, business logic next, and reset values at the end).

comment 7y ago · link · parent

You are correct. What people don't seem to appreciate are the internal conflicts within large organizations. There were in fact massive internal conflicts at Intel between the Itanic and the legacy. Companies that large doesn't "think with a single brain".

Random aside: Itanic was HP's brainchild that was adopted and refined at Intel (and far from all of Intel was excited about that). Having experienced a VLIW that _didn't_ suck (the internal engine of Transmeta's Astro 2/Efficieon) I'm sad that EPIC/Itanic gives VLIW as bad name. However, the future belongs to RISC-V.

comment 7y ago · link · parent

It's right there in the article:

> ... his target customers: “Well-to-do adventure-seekers in their mid-30s who had tried every type of extreme sport and wanted something new.”

comment 7y ago · link · parent

It looked simple enough, but I was curious about the threading example on https://github.com/joewalnes/websocketd/wiki/CPP-Input-Outpu...

The variable `count` appears to be incremented non-atomically from two different threads. Is that safe in C++?

comment 7y ago · link · parent

Yeah this is obviously a fabrication. I've had the fortune of meeting Dr Knuth on multiple occasions (at CHM) and the behavior described is 100% out of character.

comment 7y ago · link · parent

> Thus, the first 12 HP-35 portable calculators were made as a "hack" by and for other engineers at HP. It is rumored that the development engineer got carried away and implemented a full suite of scientific functions to satisfy requests from his co-workers. When these prototypes proved popular, HP decided to turn the HP-35 into a commercial product. The HP-35 was the first calculator with a full suite of trigonometric and transcendental functions.

This appears to be a summery based on the link above (http://codex99.com/design/the-hp35.html) but I think it's misinterpreted. The original states

> Eventually Hewlett, despite the SRI report, decided he wanted one and thought his engineers should have one as well. On February 2nd, 1971—Groundhog Day—he gave the official go-ahead.

The fact that he had a personal desire does not imply that it was "a hack" or anything less that a full commercial product from the start and there's no evidence to the contrary.

comment 7y ago · link · parent

> force bottling operations to standardize on a handful of containers in different sizes

And voila, that's exactly the case in Denmark

(I live in silly valley now and it makes me nauseated to have to deal with all the waste here - I refuse all the packaging I can but rarely plan well enough to bring a stainless steel container)

comment 7y ago · link · parent

While that's 100% true and Z-80's design has a legacy explanation, HOWEVER freed of the legacy requirement, there's no technical reasons why Zilog couldn't have created a much better compiler target.

comment 7y ago · link · parent

I had exactly the same security concern. It seems it would be quite easy to slip in an attack via brew.

I had an experience years ago where I discovered the lack of quality control: a typo (presumably) caused a package to regress back a couple of years. My issue used wording like "Are you serious?" which was taken as offensive and I was banned, unable to even apologize or defend myself from resulting attacks.

brew is convenient and I still use it, but I have a much higher degree of trust in packages shipping with OS distributions.

comment 7y ago · link · parent

Haskell predates the paper so no, I don't agree with your interpretation

comment 7y ago · link · parent

A random sampling (with some overlap of already discussed issues):

* A less verbose syntax (want examples?) and less bizarre syntax :) Clearly subjective, but IMhO Haskell is a lot cleaner

* Constructors starts with uppercase, avoiding the issue the issue related to misspelled constructors (and allowing most editors highlight the constructor)

* Type-classes allow for sane overloading of functions and operands, solving the int/float problem of SML, but extending far beyond just that.

* As he mentions: the infix operator and the export from modules are both fixed in Haskell

* Supports binary numbers (sure, it's a trivial library issue, but possible because of type classes allow extending the concept of numbers)

* The polymorphic equality is solved in Haskell, again, with type classes, allowing us to define equality to any user defined type in a way that makes sense for it (including the set example)

* List concatenation is right associative (he mentions SML's left associative @ as a problem)

* SML's overflow on + problem are solved by not having overflow (j/k, Haskell lack of overflow on integers is a serious problem IMO, but other than making Int === Integer there's no easy solution).

comment 7y ago · link · parent

I solved that by offering to reimburse them. So far I haven’t been asked for money.

comment 7y ago · link · parent

Yes, this was one the point that was me over when look to migrate from WhatsApp. Another winning point: it’s not tied to your phone number. So far it’s working great and I brought a kernel of friends with me.
1
363738
52