6 ms·
This looks cool enough but it would need a big community to really change the common lisp landscape (in my opinion). I wonder how the lazy sequence support stac
by mark_l_watson 12y ago
This looks cool enough but it would need a big community to really change the common lisp landscape (in my opinion). I wonder how the lazy sequence support stacks up to Clojure, Haskell, etc. support.
One difficulty with promoting a more modern layer to common lisp is that Clojure is already such a productive and practical language. I have written a few common lisp books, and remain a fan of the language, and an upgrade does sound good.
I am curious to hear the opinions of the heavy hitters in the common lisp world.
- ynniv 12y agoI am curious to hear the opinions of the heavy hitters in the common lisp world. In this case, theirs isn't the opinion that counts.
- malisper 12y ago> I wonder how the lazy sequence support stacks up to Clojure, Haskell, etc. support. A bit of a tangent, but I've been looking at the series library[0] recently. It makes it possible to write functional style code which is compiled into a loop for efficiency. For example: (defun integers () "Returns a series of all of the integers." (declare (optimizable-series-function)) (scan-range :from 1)) (defun squares () "Returns a series of all of the square numbers." (declare (optimizable-series-function)) (map-fn t (lambda (x) (* x x)) (integers))) (defun sum-squares (n) "Returns the sum of the first N square numbers." (collect-sum (subseries (squares) 0 k))) Although the above definition of sum-squares seems like it would be inefficient, it is roughly the same as the following: (defun sum-squares (n) "Returns the sum of the first N square numbers." (loop for i from 1 to n for square = (* i i) sum square)) I find it pretty awesome that it is possible to write code that is efficient and functional like that, but I guess series is a bit too magical to be put to actual use. [0] http://series.sourceforge.net/ http://series.sourceforge.net/
- Immortalin 12y agoI can understand the reasons why people prefer to target the CLR/JVM/LLVM/BEAM/Name-your-favorite-vm but I yearn for more compiled-to-native-languages such as Golang. As attractive as partially-compiled/interpretated languages are, I simply do not enjoy creating programs in a language that can be decompiled to source so easily. We need more languages that have decent performance instead of having to drop down to pointer optimizing in C wherever we need some performance. A functional Fortran would certainly be nice...
- one-more-minute 12y agoHave you met Julia? I don't know if I'd quite call it a functional Fortran, but it's not that far off, either.
- tempodox 12y agoSadly, Julia will not produce stand-alone executables in the foreseeable future. It's nothing more than a bit of native glue between two Python scripts. The main acceptance group doesn't use it for production, only in the lab.
- one-more-minute 12y agoStand-alone executables are on the roadmap for Julia 0.4, which is on the horizon (next six months or so).
- agentultra 12y agoSome Common Lisp implementations do compile down to machine code. An example of one I'm told is quite good is SBCL: * (disassemble #'(lambda () (loop for i from 1 upto 10 summing i))) ; disassembly for (LAMBDA ()) ; Size: 62 bytes. Origin: #x100306FE84 ; 84: BB02000000 MOV EBX, 2 ; no-arg-parsing entry point ; 89: 31C9 XOR ECX, ECX ; 8B: EB21 JMP L1 ; 8D: 0F1F00 NOP ; 90: L0: 48895DF8 MOV [RBP-8], RBX ; 94: 488BD1 MOV RDX, RCX ; 97: 488BFB MOV RDI, RBX ; 9A: 41BBA0010020 MOV R11D, 536871328 ; GENERIC-+ ; A0: 41FFD3 CALL R11 ; A3: 488BCA MOV RCX, RDX ; A6: 488B5DF8 MOV RBX, [RBP-8] ; AA: 4883C302 ADD RBX, 2 ; AE: L1: 4883FB14 CMP RBX, 20 ; B2: 7EDC JLE L0 ; B4: 488BD1 MOV RDX, RCX ; B7: 488BE5 MOV RSP, RBP ; BA: F8 CLC ; BB: 5D POP RBP ; BC: C3 RET ; BD: CC0A BREAK 10 ; error trap ; BF: 02 BYTE #X02 ; C0: 19 BYTE #X19 ; INVALID-ARG-COUNT-ERROR ; C1: 9A BYTE #X9A ; RCX Keep in mind that's with full run-time type checking and other nice debugging features. You can hint the compiler to turn these things off in your hardened code sections for even smaller, tighter code.