6 ms·
That's a good set of questions for 2014. Questions that have become important more recently include: - Imperative? Functional? Some mixture of both? Mixtures o
by Animats 7y ago
That's a good set of questions for 2014. Questions that have become important more recently include:
- Imperative? Functional? Some mixture of both? Mixtures of the two tend to have syntax problems.
- Concurrency primitives. The cool kids want "async" now. Mostly to handle a huge number of slow web clients from one server process. Alternatively, there are "green threads", which Go calls "goroutines". All this stuff implies some level of CPU dispatching in compiled code.
- Concurrency locking. Really hard problem. There's the Javascript run to completion approach, which reappears in other languages as "async". Ownership based locking, as in Rust, is promising, but may lock too much. And what about atomic operations and lockless operations? Source of hard to find bugs. Get this right.
- Ownership. Rust got serious about this, with the borrow checker. C++ now tries to do "move semantics", with modest success, but has trouble checking at compile time for ownership errors. Any new language that isn't garbage collected has to address this. Historically, language design ignored this problem, but that's in the past.
- Metaprogramming. Templates. Generics. Capable of creating an awful mess of unreadable code and confusing error messages. From LISP macros forward, a source of problems. Needs really good design, and there aren't many good examples to follow.
- Integration with other languages. Protocol buffers? SQL? HTML? Should the language know about those?
- GPUs. Biggest compute engines we have. How do we program them?
- zzo38computer 7y agoI would say possibly to use a different programming language for GPU than CPU. I like the idea of Checkout (see [0]) for GPU programming, although unfortunately it is not implemented and the preprocessor is not yet invented. (The trigonometric functions are also missing. They should probably have at least sine, cosine, and arctangent, since these functions seem like useful to me when doing graphics.) [0] http://esolangs.org/wiki/Checkout http://esolangs.org/wiki/Checkout
- neutronicus 7y agoI think using trig and especially inverse trig is almost always an antipattern in graphics code. Careful use of dot and cross product will almost always be both more performant and more robust.
- dnautics 7y agoJulia has done a fair job of mapping high level mathematical primitives to the GPU (though I disagree with their approach)
- kohtatsu 7y agoJust wanted to say thank you for all the contributions you add. It's always a pleasant surprise to scroll back up and see your username on a comment I just delved into.
- Animats 7y agoWell, I blew it yesterday, not knowing that Python really does do a > b > c expressions as a special case.
- renox 7y agoI`m not so sure about ownership, sure it's nice to be able to brag no GC and being memory safe, but this has a huge complexity cost.. IMHO adding to the compiler a GC/ASan for the debug mode (to detect double free, use after free, leaks) is a valid option.
- macintux 7y ago> Mixtures of the two tend to have syntax problems. My gripe isn’t the syntax, it’s the lack of guarantees/constraints. When I’m working in a language with immutable data structures, I know what to expect. A language like Python with some added functional sugar is much harder for me because I make stupid assumptions. Spent a half hour once chasing down a bug just because I was carelessly assuming list.pop() didn’t alter the list. Now I keep a Python shell running all the time so I can see whether various functions have side effects.
- Dylan16807 7y agoYou make a good point in general, but I'd be upset if a function called 'pop' didn't mutate anything. That is not the right name to use for returning an element without side effects.
- macintux 7y agoLike I said, it was stupid. I’d spent a few years working with Erlang and hadn’t yet made the mental switch.
- nonbirithm 7y agoRuby has a nice convention where impure functions like those have a "!" appended to the name. For example String#gsub takes immutable string arguments and returns a new string, but String#gsub! operates on a String instance and mutates it. I guess if you write a new programming language, it would be nice to establish that convention early on, when it's still possible to be done.
- Koshkin 7y ago> more recently 2014 was yesterday. If you look, you’ll see that nothing on your list is ”more recent.”
- deleted 7y ago[deleted]
- mcnamaratw 7y agoThe importance of GPUs for performance is new this century. The other items, ok, no.
- deleted 7y ago[deleted]
- einpoklum 7y ago> GPUs. Biggest compute engines we have. How do we program them? 1. Carefully. They only give you - roughly and unless you're super-lucky - around one order of magnitude improvement in raw flops and raw GB/sec memory bandwidth over a perfectly-exploited CPU. (Not that it's easy to properly exploit a CPU of course; it's actually quite difficult.) That means that if you cut even a few corners - you're just going to lose that edge, and a (again, perfectly-programmed) CPU beats you. 2. With a programming language which has zero or very-low cost abstractions, and models well the computations a GPU "thread" can perform. Preferably with some JIT'ing capability to be dynamic enough. For the first two, that trusty warthog, C++, does fairly well - especially with some help from nice libraries. (Shameless self-plug time... this kind of help: https://github.com/eyalroz/cuda-kat https://github.com/eyalroz/cuda-kat ; I'm thinking of submitting that to "Show HN" soon.) JITing for GPUs is maaaaasively under-explored and under-developed IMHO, and if someone is interesting in collaborating on that, feel free to write me. Would other languages do? If there's not enough ability to abstract, you get a mountain of specialized code; if there's too much abstraction, you start paying through your nose. Could Rust work? I don't know. Perhaps one of those "better C"'s like Zig? The fact that CPU-side libraries can't really run on the GPU kind of levels the playing field against languages with a large base of already-written software. > Ownership... C++ now tries to do "move semantics", with modest success, but has trouble checking at compile time for ownership errors Actually, C++ has, over the past decade or so, introduced several measures to address the issue of ownership and resource leakage. If you combine move semantics, library facilities (mostly smart pointers), the problem is half-solved. Static analysis is improving too, especially when you "decorate" parameters, e.g. with `owner<T>` or `non_null<T>` and such. The "C++ Core Guidelines" (https://github.com/isocpp/CppCoreGuidelines https://github.com/isocpp/CppCoreGuidelines) aim to be machine-checkable whenever possible.
- simonebrunozzi 7y agoHow would you try to describe the future of software development based on these (excellent) questions of yours, e.g. in 5 years from now?
- teleforce 7y agoRegarding your last point, as of now we have four main processor hardware namely CPU, GPU, FPGA and TPU (the new kid on the block). The hard question or problem is how can we program these different animals seamlessly? Chris Lattner of LLVM and Swift fame is currently working on MLIR to program heterogeneous processors [1]. At the same time ETH Zurich is working on LLHD, to unify hardware design and programming (e.g. Verilog, VHDL) including the testing or testbench that is using conventional software programming (e.g. TCL, Perl and SystemVerilog) [2]. Apparently it seems that the key concept to solving this problem is Static Single Assignment (SSA) form. It is well known that SSA can seamlessly support imperative and functional programming [3]. For the past several years, both Chris (CPU, GPU & TPU) and ETH Zurich (CPU, FPGA and Circuit Design) are independently using SSA to solve this hard problem. I personally believe SSA concept will empower the compiler community as the quaternion concept empower physicists like Einstein overcome Maxwell Equation and 3D game programmers to overcome gimbal lock. Only time will tell how this idea will pan out. [1] https://mlir.llvm.org/ https://mlir.llvm.org/ [2] http://llhd.io/ http://llhd.io/ [3] https://www.cs.princeton.edu/~appel/papers/ssafun.pdf https://www.cs.princeton.edu/~appel/papers/ssafun.pdf