News for hackers. Stuff that matters.

axle_512

Re:Introduction to Clojure (2013) on Sunday November 11, 2018 @04:58PM (#18428888)
You don’t see them in the same sense you don’t see multiple closing braces in java or c.

The style in lisp is to keep all the closing paren on the same line: ))))

But in java or C you’ll sometimes see a function that ends like: } } } }

(Hmm my newlines didn’t cone thru on those braces)

Not exactly apples to apples comparison, but it illustrates how you can start to unsee those parens.

Re:The Egison Programming Language on Saturday July 14, 2018 @06:11PM (#17532663)
Fair enough, I see your point.

Though stylistically my personal preference is for the macro to remain as simple as possible with limited syntax introduced.

Re:The Egison Programming Language on Saturday July 14, 2018 @11:28AM (#17530689)
Note I said "or looks like one".

If you squint a bit, macros and built-ins are similar in structure to functions (they're all s expressions).

I agree with much of what you said, but I still maintain that lisp syntax is still relatively trivial compared to most languages.

I also don't think exposing newcomers to macros on a language that is homoiconic is terribly useful until they're already comfortable with the basic s-expression syntax.

Re:The Egison Programming Language on Friday July 13, 2018 @10:37PM (#17528492)
In lisp, nearly everything is written in the same form. I.e. everything either is a function call or looks like one. Once you know that, you pretty much know lisp syntax.

People freak out about the parens. But I think what's the big deal? Functions are called with the paren in front of the function and the args space separated. so f(x, y) in C like syntax becomes: (f x y) - Whoop dee do, not so hard.

And since the syntax is extremely consistent, things that are math "operators" in other langs are just functions in lisp.

For "(+ 1 2 3)" + is actually the name of the function, so we are invoking + function and 1 2 3 are the arguments. Returns 6.

Once you know that, and that function args are evaluated before passed into the function, then you no longer have to worry about operator precedence and parenthesis to control order of operations. Once you get used to it, it's actually a lot simpler.

(* 2 (+ 5 5)) => 20

Re:Which editor/IDE do you use and why? on Friday January 06, 2017 @11:58AM (#13337883)
JetBrains based editors are quite nice if you can afford it. Free for students and open-source developers.

PyCharm for python, IntelliJ for java, Cursive for clojure

Re:Immer: immutable and persistent data structures for C++ on Monday November 28, 2016 @11:08AM (#13056262)
Another java library with persistent/immutable datastructures is javaslang.
From my experience several years ago:

Distributing binaries for Linux was complex. libstdc++ compatibility across distros or different versions within a single distro wasn't great.

(Compared to Solaris, it seemed like libraries were always backwards compatible. Running old binaries always just worked.)

Many have already said it, but Clojure seems to be gaining in popularity.
Re:The Case for React.js and ClojureScript on Tuesday May 06, 2014 @08:00AM (#7703883)
I used to have an issue with lisp syntax until someone pointed it out to me like this.

In c and java like languages, you invoke a function like this: f(x)

In lisp, just move the paren before the function name. What's the big deal? (f x)

Similarly, f(g(x)) becomes (f (g x)). All we did was move the paren before the function name.

The syntax is extremely consistent and it makes the lisp syntax trivial to learn. In nearly everything you do, the function name comes first the arguments come next. (+ 1 2) Here + is a function, and you are giving it 2 arguments. There are no special operators or syntax to learn. Just functions!

The mind blowing part comes when you realize that this consistent syntax combined with the fact that the code is really just written in lisp datastructures, is what makes lisp macros so powerful.

Re:An immutable operating system on Sunday February 02, 2014 @11:47AM (#7166518)
Forgot to source my info on the "om" library. http://www.infoq.com/news/2014/01/om-react
Re:An immutable operating system on Sunday February 02, 2014 @11:46AM (#7166512)
On the surface, you wouldn't think immutable data structures would offer any significant performance gains. But there are a lot of cool techniques and unforeseen consequences that emerge.

The clojure library "om" is able to use reference equality (instead of a deep comparison) to check for diffs. This results in a 2x or 3x performance gain over mutable data structures.

So I agree with you, this will likely just be a toy OS. But if his design demonstrate huge advantages, the ideas could be adopted by mainstream operating systems.

Re:Clojure's core.typed vs Haskell on Monday September 30, 2013 @05:51PM (#6472629)
nice, thanks!
Re:Clojure's core.typed vs Haskell on Monday September 30, 2013 @12:26PM (#6470454)
It is a little clearer to me how this works with things like primitives, but how do you annotate a function that takes a map as input and returns a list? (defn my-keys [m] (keys m))

Edit: Just found Seqable. Looking into it now. This link helped me a lot. https://github.com/clojure/core.typed/wiki/Types