61 points · by codr4life · 9y ago · 49 comments
Here's another interesting concatenative language in development that I'm following: http://kittenlang.org/
In particular the object/class system of Factor was baffling to me. The paradigms just don't fit together well.
I also think Lisp has an awkward object system(s). If you want that paradigm, I think a dedicated language is better.
Object systems crammed into Forth will always be baffling, the fact that it's doable doesn't make it a good idea.
I don't really buy into OOP at all; but i strongly prefer CLOS to alternatives, including Smalltalk; as it let's me reuse pieces of functionality without dealing with the rest.
Using a fundamentalist language as a foundation will always come back to bite you from my experience. I prefer my foundations as general purpose as possible, which usually means C or Common Lisp.
object.foo.bar
is apt to read more like this: (class2-bar-of (class1-foo-of object))I'm not really familiar with Forth, but my impression from writing a little bit of postfix code was that some pattern matching would make e.g. writing a large conditional much easier.
TYPE: Tree
| Branch(Tree,Tree)
| Leaf
;
:: depth Tree -> Int ;
: Branch($,$) depth {depth} dip depth + ;
: Leaf depth 1 ;
$ is extract, so the pattern Branch($,$) pops the top of the stack and pushes the 2 members. Types and type constructors have to start with a capital letter, but I like the : Pattern word definition ;
syntax a lot.How are you quickly and casually going to drop in a scripting language into any project, if it requires Common Lisp?
Maybe this means "into any CL project". But why would you need a scripting language in a CL project.
Transcript show: 'foo'; cr.
In this case the output of "Transcript show:" is the Transcript object, which is used as the sender for cr.Your Smalltalk example has a lot more special syntax going on, in a stack-based concatenative syntax it might be written as
Transcript ' foo' show cr
assuming appropriate primitive programs "Transcript", "'" (for literal quoting), "show" and "cr"Edit; I use Lisp in the form of Clojure daily as well as Forth for embedded. When writing embedded code, instead of assembly (check my profile, the stuff we use definitely has no room for Node but often not even C) I usually port a Forth if one is not available, at least for testing but usually it is good for production too.
I sometimes have to code in Python (there's always Hylang!), but all of my personal interest stuff is in the other three. I am currently going through the 4th edition of "Fractals, Visualizations and J", which is a great introduction to the J language and graphics.
I am trying to make a livecoding (toplap.org) environment in J similar to oK, but more musical and with webgl shaders [1,2].
I'm convinced the proliferation of using GPUs, distributed processing, and multi-core CPUs are all a good fit for a true array or vector-based language like APL, J, and K. I get more of a functional high on J than in Haskell, and feel like I am writing Math equations after memorizing the 'words' of J, more like operators (nouns, adverbs, conjunctions, verbs, etc...)
Shen is a great mix of Lisp and a typed (optional), lazy (optional) language with great pattern matching that has been implemented on a lot major programming platforms (Python, Ruby, JavaScript, Scheme, Haskell, Common Lisp, Clojure, JVM, and Emacs Lisp) because it runs atop a small set of 46 primitives called KLambda similar to the original Lisp 1.5. If you implement KLambda, and pass the tests, in a given PL, you can then run any Shen program on that platform [3].
[0] jsoftware.com
[1] https://github.com/JohnEarnest/ok
[2] http://johnearnest.github.io/ok/index.html
[3] http://www.shenlanguage.org/Prolog is another one of my favorites, you should check that out.
just load the binary into serial flash, point the interpreter at it, and of it goes.