4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions
comment 4y ago · link · parent
Most computer science graduates are well schooled in algorithms, complexity, linear algebra etc. However, the vast majority of their time commercially will not be spent implementing some core algorithm, but instead gluing systems together and consuming/writing APIs. Any mathematics that helps them better accomplish this would be good to add to their toolbox.
comment 5y ago · link · parent
Socialism might mean you have more choice of work, because there is greater social mobility and access to education. Perhaps also you might work for a "cooperative" firm, where every employee is a part owner and gets to vote on issues and a take on the profits.
comment 5y ago · link · parent
comment 5y ago · link · parent
>> do everything both low-level and high-level together
> This is very far from true. Like, not even the tiniest bit true
Does not really align with:
> It is easy to program in C++ or Rust and pay no attention at all to where allocations happen
(This is what high-level languages offer)
> It is totally allowed to drop to a C level of specification.
(This is what I mean by low-level)
I would also argue that in Rust the memory management unfortunately does affect the ergonomics of lambda and async, for example the need to explicitly pin memory.
I really don't mean to criticize all the recent effort that has gone into Rust, it is certainly a huge improvement over C++. But it's far from perfect and I'm arguing that is probably not the fault of any of the individual choices, but rather the language goals. I would like to see a future where we use more specialised languages; rather than the many languages that can both peek/poke bytes and implement the full lambda calculus. More specialised, simpler, languages are much more amenable to static analysis and formal methods.
comment 5y ago · link · parent
Unrelated to typing, algebraic effect handlers probably have the most ergonomic implementation of async I have ever seen (looking at the OCaml multicore previews).
comment 5y ago · link · parent
This is because many insist on having one giant programming language to do everything both low-level and high-level together. Rust just follows C++ along this same path. The resultant language will always be a complex compromise that is suboptimal for almost everything. For example, both Rust and C++ have too many high-level abstractions to easily reason about where allocations will happen and their manual memory management makes lambdas and async painful. I personally would favour the use of multiple languages. Such an approach is commonly emerging anyway due to practicalities, e.g. Python/C/Fortran use in machine learning.
comment 5y ago · link · parent
let foo {x, y} = x + y
in foo {x=1, y=2}
The function "foo" above has type: { x:int, y:int } -> int
Again, a nominal type can always easily be created from a structural type.comment 5y ago · link · parent
t -> bool
Much simpler and easier to consume.How would you assign a nominal type to the result of a SQL query?
So there are arguments on both sides. My point was that structural types can always easily be turned into a nominal type, but not the other way around. Therefore they should be the default.
comment 5y ago · link · parent
Every C or Java programmer writes a function definition in terms of a tuple of parameters, despite not having first class tuples. Functional programming languages can also return tuples, but where are the anonymous records? These would allow defining functions with named arguments essentially for free.
comment 5y ago · link · parent
As I suspected. So of course this tells us very little about how fast idiomatic code is relative to other languages. "The best I can do" is to invoke hand optimised assembly language, but rarely is that the right choice.
A much more useful test would involve benchmarking some similar real world apps that solve the same problem.
comment 5y ago · link · parent
Are these programs benchmarking typical idiomatic Java, or just some subset of the language?
comment 5y ago · link · parent
comment 5y ago · link · parent