Hacker News new | ask | show | jobs
by alexbw 3837 days ago
Neat stuff. Are data structures up to the programmer, or are there primitives for e.g. matrices?
1 comments

Matrices are easy enough:

    var grid = ispace(int2d, { x = 4, y = 4 })
    var matrix = region(grid, float)
But beyond that, most things are left to the programmer. E.g., if you want to build a mesh data structure, it's up to you to decide exactly how to build it. (Do you build a graph with pointers? Do you make it an N-dimensional grid? etc.) But my impression talking to application programmers is that most of the time, they want to make those decisions themselves anyway. A standard library might be nice, but it's never going to fit all use cases. So the first job of any language design is to make sure the abstractions are general enough to describe what users want.