10 ms·
SBCL: The Ultimate Assembly Code Breadboard
- 616c 13y agoI am still trying to get a handle on Lisp and Scheme, but blog posts and projects like this, and the Common Lisp OS posted here previously [0] make me really impressed and confused about why people, if you dislike the Lisp style and philosophy, cannot admire its bizarre powers. I mean, I see most languages from that paradigm (why hate when you can be entertained, either by the good or bad), but this is very cool and way over my head. [0] https://news.ycombinator.com/item?id=146670 https://news.ycombinator.com/item?id=146670
- deleted 13y ago[deleted]
- orthecreedence 13y ago> cannot admire its bizarre powers Pure jealousy =]. People like to rag on lisp, but their language dujour just got what lisp's been packing for at least 20 years. Between the interactive programming model, compiling to machine code, real threading, macros, and many other features, it's the perfect secret weapon.
- powersurge360 13y agoIt is my understanding that threading is a sore topic in most common lisps having either poor or experimental support. I'd love to be proved wrong, however.
- ScottBurson 13y agoMost Common Lisp implementations have had good threading support for years now, at least on the implementation's primary platforms. The threading APIs, however, are all different -- not necessarily in any deep way, but in incidental ways like function names and signatures. There's a package Bordeaux-Threads that provides a portable API layer on top of the various implementation-specific APIs.
- orthecreedence 13y agoAll these problems are fixed. Most implementations provide stable threading on most platforms.
- eru 13y ago> People like to rag on lisp, but their language dujour just got what lisp's been packing for at least 20 years. Strong static typing? ;o)
- 616c 13y agoWell as I have pointed out before, I am still learning but there are few interesting propositions here. core.typed - Type Clojure, but still not complete Shen - despite its questionable licensing scheme, it is a derivative of Qi. Qi and Shen are very powerful types systems (not just Haskell, but think even more complex like Idris, Coq, Agda, etc). The original implementations, if you want irony, are Common Lisp. The caveat is Shen has been ported to other runtimes, namely, Python and Ruby. But SBCL is the preferred runtime layer for Shen's crazy type system. Typed Racket - It is a Scheme, and people will throw things at me, but I think it safe to say static types for this subset prove Lisp family languages have the potential for robust static typing systems you hint at. TL;DR: Strong static typing is not common (pun intended), but it is possible. I think what we want to see is Shen with a good license: a very robust type system with a Lisp, separate or library. Then, Lisp will be the one ring-language to rule them all. Perhaps we can call this library or Lisp variant Precious, and its hipster vote can go through the charts.
- xenophonf 13y agoCommon Lisp already features strong static typing (the example below uses SBCL): * (defun foo (x) x) FOO * (declaim (ftype (function (fixnum)) foo)) * (defun bar (y) (declare (string y)) (foo y)) ; in: DEFUN BAR ; (FOO Y) ; ; caught WARNING: ; Derived type of Y is ; (VALUES STRING &OPTIONAL), ; conflicting with its asserted type ; FIXNUM. ; See also: ; The SBCL Manual, Node "Handling of Types" ; ; compilation unit finished ; caught 1 WARNING condition BAR One could also declare the function signature first (perhaps in skeleton code generated by modelling tools). Then, if someone implements it incorrectly, the compiler will throw an error (again, SBCL): * (declaim (ftype (function (fixnum)) qux)) * (defun qux (z) (car z)) ; in: DEFUN QUX ; (CAR Z) ; ; caught WARNING: ; Derived type of Z is ; (VALUES FIXNUM &OPTIONAL), ; conflicting with its asserted type ; LIST. ; See also: ; The SBCL Manual, Node "Handling of Types" ; ; compilation unit finished ; caught 1 WARNING condition QUX So, what else do you think Common Lisp lacks compare to more "modern" languages? ;)
- epsylon 13y agoAs much as I find lisp interesting, I've always hated the kind of smug comment like yours that every discussion on Lisp inevitably brings. Lisp is certainly far from perfect, and there are a ton of good technical reasons why people use other languages.
- orthecreedence 13y agoConsider it a response to the "lol you use lisp?!? that's really old right??" bullshit you heave to hear whenever you tell someone you use it. Nobody said lisp is perfect for everything. Just that it's better than most people are willing to give it credit for. For instance, I'd use C for embedded systems, tight control of memory, or building libraries I wanted to be used everywhere. I'd use Erlang for distributed programming. I'd use Haskel if I needed pure functional programming. I'd use Java if I had a team of 500 engineers working on an enterprise app. For any other general-purpose programming, I'd probably pick lisp.
- eru 13y ago> I'd use Java if I had a team of 500 engineers working on an enterprise app. If possible, fire 490 of them, and switch to a saner language. Quintuple the salary of the remaining ten, and pocket the difference.
- orthecreedence 13y agoSorry, but the director of product vision, who's my boss (as dictated by a complicated blame-shifting matrix of dynamic management) heard 12 years ago that Java is a good language for the kind of things he thinks we're probably building. He even gave us an incomplete UML spec to get started with!
- waterhouse 13y agoSite is currently down for me, presumably deluged by traffic. A Google cache exists, but at least on Chrome it still needs to load something from pvk.ca before it displays any portion of the webpage. Therefore, here is the page source with most of the markup removed; you can get from it some idea of what the page is about. http://pastebin.com/JL7aRcpn http://pastebin.com/JL7aRcpn
- mjn 13y agoIt looks like he (accidentally?) included a gigantic scanned image in the post. However most of the comments on the last pvk.ca post submitted here were also about how it's down (https://news.ycombinator.com/item?id=7286655 https://news.ycombinator.com/item?id=7286655), so the blog config/hosting might just be borked. Google Cache seems to always try to load the images and hang for a while if the site is unreachable (not sure why, since if the site were reachable I wouldn't be on Google Cache in the first place). You can click "text-only version" in the top-right to stop that.
- pkhuong 13y agoThanks for the heads up on the scan! That's what I get for publishing just before rushing to dinner. The blog is just a bunch of static files, so there shouldn't be any issue. This situation is really annoying; I'll figure something out soon.
- zachbeane 13y agoThere's a readable copy on http://planet.lisp.org/ http://planet.lisp.org/
- larrybolt 13y agoIt loads for me currently, after a bit waiting though, here is a mirror: http://archive.is/8WQV5 http://archive.is/8WQV5
- deleted 13y ago[deleted]
- jgalt212 13y agoPeople love to go on and on about the power of macros, but for me, what separates Lisp from the crowd is that it's a compiled language with a REPL. Are they any other usable compiled languages with a REPL?
- pjmlp 13y agoAny language can have a REPL, it is a plain implementation issue.
- lispm 13y agoIt's not. You will detect that in many cases it is a language issue, too. If you look at Lisp, you can see that the language definitions are optimized for interactive use and have a lot of facilities defined at the language level: incremental definitions, evaluation, effects of loading code, a robust interactive error system, ...
- pjmlp 13y agoHow come it is not? - Create an interpreter library for language X - Offer a GUI/CLI application using the said library Not all repls need to work at function level like LISP does.
- mark_l_watson 13y agoSBCL is an amazing project. I use it for some personal projects, but where the SBCL community really shined, in my experience, was on an AI for medical records project I worked on several years ago. We had some issues with SBCL that were fixed very quickly. A nice experience.
- rumbler 13y agoThank you! I did not know about SBCL, or Paul Khuong, before. This is the most interesting thing I've read this week. This kind of article is why I come to Hacker News.
- bsder 13y agoThe only thing I would point out is that "free" FXCH isn't free. It has quite a lot of baggage inside the microprocessor and was something that designers made a conscious decision to support (see Pentium vs. AMD K5). There are good reasons why hardware supports registers instead of a stack. However, given where x86 was at the time, the hardware designers of the time took the penalties because the gains to the software folks justified it. Those choices no longer hold.
- gwu78 13y agodjb once wrote a FORTH-like interpreter. Anyone get that old code to run today? I have always thought think LISP/Scheme's "best" use is to write code generators (e.g., that output C or asm). I know there's at least one LISP/Scheme project that outputs C, so I know I'm not alone in thinking this can be useful. FORTH has always seemed better suited to driving hardware than any LISP/Scheme. This is some sort of bias perhaps. These are both very flexible languages. What if historically programmers tried to use FORTH for "AI" and LISP as a "portable assembler"?
- protomyth 13y ago> What if historically programmers tried to use FORTH for "AI" and LISP as a "portable assembler"? Then I guess the Burroughs B5000 and its ilk might have become a popular machine for AI research. We would have had Stack Machines instead of LISP Machines.
- lispm 13y agoLisp Machines were mostly stack machines.
- agumonkey 13y agoI'll just throw that in here, as I always do, in case people want a nice historical overview (yet detailed) of stack machines : http://www.eecg.toronto.edu/~laforest/Second-Generation_Stack_Computer_Architecture.pdf http://www.eecg.toronto.edu/~laforest/Second-Generation_Stac...
- abecedarius 13y agoI have in fact written a Forth dialect, but I'm guessing you mean some other djb. :)
- gwu78 13y agoWell done. What language did you use to write it?