5 ms·
Single assignment C
- GuiA 13y agoThis is neat. I studied APL recently (through Ted Nelson's fantastic intro in Computer Lib), and ever since I've been intrigued by some of the neat ideas/conciseness that array languages offer. (I have too many side projects/side project ideas already, but would love to write a toy "modern" APL just for fun)
- kaoD 13y agoCheck out J[1]. It's basically ASCII-APL though it lacks a toy modern implementation (in case you don't know, APL has one[2]). What really annoyed me about array languages is that idiomatic code is nearly impossible to follow after a month, so I ended up aliasing many of the commands to more verbose alternatives and using longer traditional constructs like IF-THEN-ELSE. That pretty much turned the language into weird-C-limited-to-binary-functions-with-an-array-stdlib, which kind of defeated the point. [1] http://www.jsoftware.com/ [2] https://github.com/ngn/apl
- X4 13y agoOh My God.. I tried to learn APL for about two days some years ago and all I gorked was just basic stuff. Then I found out J and recommended that to our APL loving Prof. who converted from his about $2000 expensive prorietary APL symbolic minfu to the free J alternative. I could write much more with J, but Julia still feels more natural. I've not made any speed comparisons, but maybe you can give APL, J, Julia and SAC a bench? That would be neat! A simple hello world like example, for example using the same FFT algorithm, or "addition" loop would be enough.
- mehedihasan_a 13y agoany one call telme how can i submit a link
- Hellenion 13y agoYou mean https://news.ycombinator.com/submit https://news.ycombinator.com/submit ?
- SPSteinbeck 13y agoif you're IQ is as low as that sentence seems to indicate ... please don't. Thanks (faggot).
- rbanffy 13y agoIs it being maintained? Last release seems to be from February 2012.
- merijnv 13y agoIt's still being actively worked on, due to a recent move to a different university a lot of the infrastructure (such as building new releases) is still offline, so the website hasn't updated in a while. Blame university IT departments.
- rbanffy 13y agoAny public repository to track?
- merijnv 13y agoThe compiler implementation isn't really open source at the moment. On the other hand, they're very interested in new collaborations. Getting access to the source is not much harder than just dropping them an email. If you (or anyone else) is interested, drop me an email (see HN profile) and I can get you in contact with them as most of the people involved are either current or old colleagues of mine.
- mbq 13y agoArrays by row? Why?
- vanderZwan 13y agoBecause normal C is also row-major?
- mbq 13y agoC only has vectors (1D arrays), the implementation of higher dimensions is up to programmer. I know there is this idea to use vectors of vectors to emulate matrices but it is not at all a part of the language (nor efficient).
- beagle3 13y agoSo what do you call x in the definition int x[100][83]; Sure looks like a 2D array of ints for all intents and purposes.
- hello_hi 13y agoThat's not a 2D array, it's a jagged array. You're paying for an extra pointer dereference.
- Peaker 13y agoYou're wrong. Operationally, it is equivalent to: int x_1d[8300]; Where x[a][b] is x_1d[a + 83*b]; An array of arrays is contiguous in memory. There are no pointers involved until you take the (r)value of the array or one of the inner arrays, at which point it is degraded to be a pointer to the array's first element, as always.
- norswap 13y agoAnd I'll also add that this is not an optimization, it's guaranteed by the standard.