Showing posts with label languages. Show all posts
Showing posts with label languages. Show all posts

December 10, 2010

Something nice about every language I've used

Inspired by this post (and more great answers on the reddit comment thread), here's one nice thing about each of the languages I can remember using in any meaningful capacity:

Java: I learned to program in this. It led to the creation of the JVM, and while Java isn't my favorite language, the JVM is a pretty sexy piece of technology that enabled a number of other languages (Scala and Clojure most notable) to flourish.

C: The closest thing imperative programming has to "sparse beauty," a la Scheme. Shows you really don't need many bells and whistles to do a job, and do it well.

C++: Back when everyone was using C, it's kind of a technical miracle that Bjarne could create a proper superset on top of C with the features it has. Further, it's still blazing fast; without it we wouldn't have all the video games we love today ^_^.

PHP: Incredibly easy to learn, and no-hassle to set up on a server. One of the matches that lit the web on fire.

Racket (and Scheme applies here too): The language that never lets up. The most delicious learning curve I've ever tasted. Like Wagner's music is jokingly said to be "better than it sounds," Racket is more fun and fulfilling than it deserves to be.

Erlang: Industry-proven functional programming with more concurrency love than 1000 suns. Also the top language for gaining hipster-programmer cred. When you drop this name, suddenly everyone looks at you like "that guy" (you can decide if this is what you want or not).

Haskell: A wolf in sheeps's clothing, the most modern, practical, and supported language with features I think we'll see as necessary in the future. Another candidate for learning curve that keeps on giving.*

SML: A really sick module system for programming in the large. While not my favorite for "programming in the small," an understanding of SML's module system makes you pity that it never really took off.

Ruby: One of the most beautifully designed, fully-realized languages I know. Shows you can make a language that is simple, with practical value for Herp Derp programmers without sacrificing power and flexibility for the craftsmen as well.

Objective-C: The real "C with objects." Message passing with named parameters (and the much more sensible #import rather than #include), this is one time where I'm highly in favor of Mr. Jobs' stubbornness.

Prolog: 10-second youtube video. I mean this in a good way.

Max/MSP: Probably the most fully-realized and pleasing graphical programming environment I know, as well as an example of a damn fine DSL.

Javascript: I don't have to worry about compiler errors! No seriously, prototypical objects for the masses.

Flapjax: Functional reactive programming! An excellent example of functional languages and concepts attacking problems from the language level. Very innovative workaround for the horrors of client-side programming of the time.

Actionscript: Adobe makes it! Like Java, but better (Flash Platform > Swing/most Java GUI's).

*= Small qualification on the learning curve lines: virtually any language takes years of work over dozens of programs to "master." But many times mastering a language means compensating for its weaknesses, not discovering new strengths. That's what Haskell and Racket have given me more than most other languages.

November 13, 2010

The Road to Lisp Survey

I, Paul Meier, do solemnly offer these responses to the Road to Lisp Survey:

When did you first try Lisp (meaning here and throughout the survey "any member of the Lisp family") seriously, and which Lisp family member was it?

I took Lisp seriously after my first exposure to it, in Shriram Krishnamurthi's programming languages course, based on his excellent book, PLAI (download it! it's free!). We mostly used Scheme for the course (the implementation now called Racket), and while I could call the programming from that class my first exposure, I really only explored it during self-study after the course.

In the Preface to his book, Shriram mentioned The Little Schemer as a good introduction to thinking in Scheme. In the Acknowledgments, he said "Please read those magnificent books even if you never read this one" of two books, one of them being Structure and Interpretation of Computer Programs. I picked them both up that Winter, and I was hooked.

What led you to try Lisp?

The answer is really in the next question, but I'll also mention that this was not just my first exposure to Lisp, but functional programming as a whole. While I enjoyed programming to a point, what really interested me in Computer Science was the strong theoretical results we'd achieved: the fact that we could prove undecidability kept me awake for weeks.

So part of my migration to Lisp wasn't just to homoiconic syntax and dynamic type systems: it was also the wonders of functional programming I would find prominently in Scheme.

If you were trying Lisp out of unhappiness with another language, what was that other language and what did you not like about it, or what were you hoping to find different in Lisp?

I took the languages course at the same time I took our excellent graphics course, where we used C++. I found I spent much, much longer debugging the C++ programs, for a much less interesting class of bugs. You'd pull your hair out, looking at memory addresses and pointer values only to find you did your pointer arithmetic wrong (we were investigating a two-dimensional matrix stored as a linear array), or that a state change occurring in an edge case was leaving your program in an inconsistent state. It was frustrating, to say the least.

In Scheme, I was only fixing logical bugs. I spent more time thinking than typing. My programs were shorter and elegant. It's as if, by framing the problem differently, hundreds of edge cases and corner cases simply ceased to exist.

And there's something to that. Removing state means putting a lot more effort up front, but ultimately makes your programs worlds easier to write and maintain after you've invested. Not to mention spending your brain cycles modeling is worlds more fun spending them debugging.

Of course, I didn't know that back then; I moved because I just had the feeling they were doing something right, and I could learn something valuable.

How far have you gotten in your study of Lisp? (I know, that is hard to measure)

This is very hard to say. In many ways, I'm still a novice, since most of my Lisping doesn't take full advantage of macros, Lisp's crown jewel. I'm still much more comfortable in Scheme than CL, Clojure, or Arc; I'd call myself a competent Lisp programmer having written a few small programs and baby scripts, with a toe in advanced and a longing to go expert.

What do you think of Lisp so far?

I think it's still a very advanced, progressive way to approach programming, at least with smaller engineering teams. I'm completely unsurprised it's not used in industry as much; it's a large investment, and languages rely heavily on community. Incidentally, I feel the only real rival to Lisp in caliber would be Haskell, who's unofficial motto is "avoid success at all costs." ^_^

--------------

Also, any of you see atomo? It looks pretty hip, if ambitious...

November 7, 2010

THE LAND OF LISP

It's been a while since I've been able to run through a code book, with life throwing me so many welcome curveballs since the summer. But I'm finally taking the time to work through a book like old times; this go-round is with Conrad Barski's Land of Lisp. I probably wouldn't have gone for it, but the music video he made was just too cute:



The book is peppered with cute cartoons and a whimsy feel that is endearing, not overbearing. I highly recommend it, if only for the comics (though working through the examples is fun, the games you make really highlight Lisp's strengths).

Some may recall that I've dabbled in CL before; sadly that affair was over before it started (curveballs!), but my next project after ScrabbleCheat will likely be in either Haskell or Common Lisp ^_^

And how goes ScrabbleCheat? Quite well, actually! The technologically adventurous can download and play with it now. What I'm working on now is a simple UI in ncurses, which will probably take another week or two. But as soon as that's up, the program should not only be functional (which it mostly is now), but usable!

September 16, 2010

Living Openly

I just wrote a long blog post talking about why it sucks playing Zerg in Starcraft 2. But friends, there has been too much whining on this blog of late! It's time to bring back two things we've missed for some time: computers and whimsy!

Haters Gonna Hate

So a few things: I'm living the dream, and finally installed Linux on a personal box. It's a small step (this is my laptop, not my main) but Perfect is the Enemy of the Good, and after using Mac, Windows, and Linux at work, it's incredibly obvious which direction I'd like to move in for the future.

Currently I'm running Ubuntu. I wanted to run Debian like we did at Brown CS, but I'm too much of a weenie at the moment. Besides, Ubuntu's easy as a dream to set up, and I've done it for work twice already. Naturally, I'll be using XMonad as my window manager ^_^

I've written twice that I've "picked up" ScrabbleCheat again, but they were lies. This time I've actually picked it up again (see the commit history!) and it's finally going in the right direction. I had a substantial amount in the first tagged release, but that approach (the anagram solver) was ultimately doomed because it didn't take the board into account when generating words for moves. If I ever get productive again, I'll write about this process, this has been the most fun I've had coding in a while.

Part of the fun has been because of Erlang, which has just had another release. There are so many reasons to use Erlang, and this application contains almost none of them (not super parallelizable, no need for hot-swapping patches, binary syntax, or fault-tolerance). That being said, I really miss my functional programming, and refactoring calls to a series of folds and maps just feels nice. I can't imagine how powerful I'd feel if I'd properly learned macros, or had use of Haskell's type system. Those are for the next ones ^_^

Finally, Diaspora open sourced today. It's too early to really tell anything about its future, but I'm thinking of looking at it and seeing what they did. If we're lucky, the community will take well to this I can finally stop being a dumb fuck who trusts Zuckerberg.

(Note that while I don't love all aspects of the product, my family will always be eternally grateful to Facebook for helping us communicate to so many, so easily during the roughest parts of Annalisa's recovery. I also think their approach to engineering, like many of the coders I know there, is brilliant).

Finally, I'm turning in my iPhone in late October and getting me an Android (probably an Evo), since I'll be paying that bill pretty soon and will use the opportunity to go to a more open land, containing the closed platform I work on ^_^.

So that's it, kids! Open source OS, programming an open-source hippie language, slowly migrating out of Facebook while decking it out with a new, more open phone. All that will be left will be a bed that's also a Reprap.

Since Day 1

I'll try to post more; I still sleep next to too much cardboard and styrofoam, and will probably be comfortably moved in and adjusted after Christmas ^_-.

July 18, 2010

MAGNETS, HOW DO THEY WORK?

Let this be a myriad post with some of the trends that currently come up in this blog:

Music. This was shown to me by a former roommate, and while acapella isn't normally my thing, I found this pretty hip:



Internet lulz. I never really cared much for Insane Clown Posse (see this lame interview, where they manage to make Bill O'Reilly look like the slightly saner party). I had never been exposed to this, a 2009 release that compares to Brokencyde in claw-your-facedness:



What makes this more notable is the meme arising from the line "Fucking magnets, how do they work? And I don’t wanna talk to a scientist; Y’all motherfuckers lying, and getting me pissed."

Murrrrrrrrr.

(edit: Madly Brilliant throws me the link to an SNL parody of the video, which I found sufficiently lulzy).

Programming languages. I like the tone and content of Mozilla's "A re-introduction to Javascript." While I don't love everything Douglas Crockford writes, but I agree with him in that there's a beautiful language trapped deep inside Javascript trying to get out. This helps us get there.

Also, reddit has started a mini-course on programming language math and formal specification/semantics. While it's too early to tell how successful it will be, I'm rooting for it!

----

I have lots more to write about in the coming days: soon I move to San Francisco, and I just took a trip to the Midwest. Now though, I have to pack!

July 6, 2010

Languages to describe Languages

We're in a beautiful, exciting, and unsustainable time in programming languages. For any combination of features you could want, someone's made or making an interpreter/VM for you. Want dynamic message passing and objects (but Objective-C doesn't give you enough functional features)? Try Newspeak. Want Ruby syntaxed immutable objects with Erlang's concurrency model? Try Reia. Hell, did you Perl programmers feel left out of the JVM after the success of Jython and JRuby? Someone made a JVM-styled Perl called Sleep.

I remember wondering what my contribution could be and thinking I love Ruby programming, with true object-orientation, but miss ML/Haskell type systems and inference. What if I could make a concise, type-inferred Object-Oriented language? Then I found Scala had already been made.

Reading so many new language pages, I notice that lots of older languages getting referenced to describe the current one. Carlos Fuentes pointed out that Guatemala used to be called "The Paris of the Americas" (he also pointed out that France did not return the favor and call Paris "The Guatemala of Europe"), and there are a few specific languages that get to be Paris most often.

The ones I see most are...

  • Smalltalk. When you see this it normally means the referencing language has dynamic message passing, or actual object-oriented programming where everything is an object (Recall C++/Java/Objective-C have primitives).

    What they don't mean, which is a major part of Smalltalk culture, is programming in 'an image.' Newspeak, mentioned above, runs on Squeak, the open-source image-based Smalltalk development environment. I've never developed in an image so I can't really speak for it, but for those more comfortable with files, there's GNU Smalltalk, which I finally got running.

  • Self. It's kind of funny seeing this get so much love, after Javascript got so much hate. But apparently prototypical objects are all the rage, with projects like Io, Neko, and Slate. This usually means supporting Prototype-based objects.

  • Lua. This seems to mean "will be well-executed, lightweight, and hopes to get used in industry!" Feels like name-dropping when I see it.

  • Lisp. I think this just means "feels flexible," since the defining feature of the myriad of Lisp languages is homoiconic syntax, allowing for rich macro programming. Using "Lisp" as a signpost is a little lame since, if you had it homoiconic syntax, it would make your language a Lisp. Using "Lisp" in place of better terms reminds me of terms like "strong typing." Murrrrrr...

    To go with the flexible vibe, they probably also mean dynamic types + garbage collection, which Lisps did pioneer way back when. But those features are everywhere now.

What languages do you never see anymore? Prolog, Forth (except the very nice-looking Factor), or Eiffel. That's too bad, these had some fun ideas.

What language feature/system do I feel needs to make a resurgence? Proper module systems, like SML. I find most module systems a royal pain, and SML is no exception. But once you figure it out, you really can (provably!) 'program in the large.'

Finally, what hope is there for us polyglots to do development in these languages? Aside from LLVM, maybe there's a good graduate research project-in-waiting trying to bridge the gap between these guys.

That's enough bloviation for now. Now let's write some code.