News for hackers. Stuff that matters.
Re:Mu: making programs easier to understand in the large by antiquark on Friday February 12, 2016 @09:58PM (#11092245)
How is "subtract a, 3" better than "a-3"?

I can already feel my carpal tunnel acting up!

Re:Mu: making programs easier to understand in the large by akkartik on Friday February 12, 2016 @10:57PM (#11092448)
It translates to assembly/machine code with a lot less code. I don't need a compiler, I don't need to write optimizations.[1]

I actually don't consider Mu to be a language. (I'm the author.) It's a low-level starting point to explore ways to make the standard OS primitives more testable. I don't need it to look nice. Higher level languages can come later, once the foundations are in place.

I actually am growing increasingly suspicious of all our navel-gazing about syntax. We spend all our time in places like HN thinking about how to make small screenfuls of code look nice, but all that effort hasn't really translated into helping me understand the large-scale structure of random open-source codebases more easily.

Perhaps one way to think about it is that syntax helps insiders keep a codebase in their head. I'm more concerned with ways to help more outsiders import a codebase in the first place. Because people leave and move on, and it's very hard for software projects today to improve once their original authors move on. More on this: http://akkartik.name/post/readable-bad

(I'm susceptible to carpal tunnel, but it hasn't become a bigger issue. I take wrist breaks.)

[1] I can even imagine doing the translation in machine code, so that Mu then becomes self-hosting without needing any of the current stack. I might go down that road..

Re:Mu: making programs easier to understand in the large by skewart on Friday February 12, 2016 @11:46PM (#11092585)
"I'm more concerned with ways to help more outsiders import a codebase in the first place."

This. The pain point that mu addresses is huge. I haven't really looked at the project in much depth yet, or played around with it, but I love that you are tackling this issue. I have spent way too much time wandering around a big code base trying to build mental models of what's going on, and thinking to myself the entire time "there's got to be a better way."

Re:Mu: making programs easier to understand in the large by userbinator on Saturday February 13, 2016 @01:28PM (#11095046)
I don't need a compiler, I don't need to write optimizations.

You've effectively created a sort of portable assembly language, but it's more verbose than usual assembly language ("sub eax, 3").

but all that effort hasn't really translated into helping me understand the large-scale structure of random open-source codebases more easily.

I think the root of the problem is that software is being written to be more complex than it could/should be, so the solution is to encourage reducing complexity.

Re:Mu: making programs easier to understand in the large by akkartik on Saturday February 13, 2016 @01:54PM (#11095164)
You've effectively created a sort of portable assembly language

Exactly. The verbosity is mostly because of my teaching project. I think teaching assembly can be just as ergonomic as teaching a high-level language. Indeed, most of us from a generation ago learned programming using assembly. It just needs to get a little more ergonomic.

the solution is to encourage reducing complexity.

Yup. The problem is that human beings have a _terrible_ track record at managing complexity. It's not just every software project ever; think about the creep of bureaucracy in ancient China, or the creep of legislation in ancient Rome. Everytime we've created a repository of rules it's gotten complex (and then gamed by smart operators). I think the problem is that it's very hard to justify removing a rule, so such repositories grow monotonically. The only way to periodically prune unnecessary rules is to first track why you created them in the first place (https://en.wikipedia.org/wiki/Wikipedia:Chesterton's_fence). Hence: tests! I think they are the great advance bequeathed to the human race by software. And they're far more broadly applicable outside software -- though I have no idea how to do this applying. I wrote up some speculative ideas about it at http://www.ribbonfarm.com/2014/04/09/the-legibility-tradeoff a couple of years ago, but that piece isn't very clear.

Re:Mu: making programs easier to understand in the large by dman on Saturday February 13, 2016 @08:21PM (#11096631)
While working on large code bases I have often (in half jest) wished for the concept of a runtime performance tax on code that is engineered poorly. Some variants of this could be a. Imposing an exponentially increasing programmatic sleep on functions based on their length. b. Repeated database / filesystem / network requests for identical resources multiple times in a program should again incur a slowdown.
Re:Mu: making programs easier to understand in the large by chipsy on Friday February 12, 2016 @11:52PM (#11092603)
This kind of consideration has led me down the road towards XML, because it's the syntax that is powerful enough to model documents that bundle a mix of schemas(including source formats with their own idiosyncratic syntax). It is not a syntax anyone wants to type in or read, but that one advantage counts for a lot, given the right problem domain, because it pushes the semantic content to the center.
Re:Mu: making programs easier to understand in the large by dorfsmay on Saturday February 13, 2016 @09:02AM (#11093929)
Why the comma? Why not

    substract a 3
or even:

    (- a 3)
Re:Mu: making programs easier to understand in the large by akkartik on Saturday February 13, 2016 @12:17PM (#11094728)
The comma is optional.
Re:Mu: making programs easier to understand in the large by FenugreekAcerb on Friday February 12, 2016 @10:12PM (#11092298)
Some say (for example Moore) that arithmetic is only a tiny part of programming and don't deserve special syntax (especially with a language that lacks C-style for loops).
Re:Mu: making programs easier to understand in the large by Terr_ on Friday February 12, 2016 @10:40PM (#11092383)
...Well, a tiny part of whose programming?

Programming languages (at least the not-so-academic kind) need to mesh with the problem-spaces being solved, and there are definitely some contexts where most of the work is encoding and applying arithmetic rules.

Re:Mu: making programs easier to understand in the large by ktRolster on Friday February 12, 2016 @10:55PM (#11092436)
Really all you need for programming are > < + - . , [ ]

Anything more than that is for wimps. Brain is the only language I ever program in.

Re:Mu: making programs easier to understand in the large by slang800 on Saturday February 13, 2016 @11:20AM (#11094501)
I think you mean "Brainfuck", I can't find a programming language called "Brain".
Re:Mu: making programs easier to understand in the large by ktRolster on Saturday February 13, 2016 @12:39PM (#11094831)
I haven't been posting here long, so I wasn't sure if it was acceptable to type 'fuck.' So I self-censored by replacing it with asterisks, which hackernews promptly ate. So yes, you are right of course.
Re:Mu: making programs easier to understand in the large by akkartik on Saturday February 13, 2016 @02:17PM (#11095273)
Each pair of asterisks turned into an empty italic block due to HN's formatting rules. You can see them if you view source :)