28 Replies - 9167 Views - Last Post: 25 January 2013 - 11:37 AM
#16
Re: The First Program Language Conundrum
Posted 18 April 2012 - 02:23 PM
It's quite simple, but tough with the rules.
One has to do things right without funny tricks.
#17
Re: The First Program Language Conundrum
Posted 19 April 2012 - 08:19 AM
I have spent between 5 to 30 hours playing with various languages over the past little while. I am captivated by LISP. I spent 8 hours reading about it yesterday after I stopped playing with it on my machine. It seems powerful, graceful and filled with potential. I want to learn to code. I am not sure I can explain it but I need to learn LISP.
Documentation is terrible -- hello world took over 2 hours because I was struggling with the environment. Yet it is so simple & useful. The simple convention of
(+ 2 3)
rather than 2 + 3
makes more sense when you stop for a moment and let yourself ponder it. I was up till 6am reading about cons and pointers and have taken the day off to play with Common LISP and try and learn some basics. Nothing has caught my attention like this. I am going to have to force myself to study JAVA - in fact I created a simple program I need to finish and will do a couple more but I already see how to rewrite in LISP. GUI is obviously an issue.
Okay so I am obviously all over the place but after all of the helpful comments I felt I owed you all an update. Also sporadic random LISP notes at http://codingwithalisp.wordpress.com
This post has been edited by Magooguli: 19 April 2012 - 08:20 AM
#18
Re: The First Program Language Conundrum
Posted 19 April 2012 - 08:56 AM
Don't worry too much about the GUI for the time being - just get comfortable with the language for now. Once you're comfortable passing functions around I think GUI programming will make a lot more sense.**
A lot of people find that EMACS + SLIME is a good environment for lisp hacking... I'm usually a vi guy, but SLIME works for me. That might be a little much to absorb all at once though. If so, just work in the clisp REPL until you get the hang of it.
There are a few books that might be useful to you.
Conrad Barski's Land of Lisp is a fun introduction to some serious ideas, using full-fledged games as the working examples. The material is deep, and I don't think Barski gets you all of the way there, but it's engaging and a good start.
Felleisen and somebody's The Little Schemer primarily deals with recursion and related topics - excellent guide to the lisp mindset, but almost no practical code - very abstract, very usful. Targets the scheme dialect of Lisp. It's close enough to common lisp that you shouldn't have any trouble, or you can run through the book in mit-scheme or racket, both of which are easily available.
Also scheme-oriented, Abelson and Sussman's Structure and Interpretation of Computer Programs is a classic. Available on the web for free, and it's the text for their MIT course of the same name, which is also available for free.
*clojure is a lisp which targets the jvm. Haven't seen Raynes around lately, but he's always been DIC's clojure maven. I'm not really sold on clojure yet, but don't let that stop you from trying it. My advice, if you were to ask me, would be to get happy with the basics of lisp (and maybe scheme) before diving into clojure, since it does depart from the core lisp in some significant ways, which might be pretty confusing to take in this early. But again, just because I said it doesn't make it right.
** one advantage of clojure, of course, would be access to java's graphics libraries. but there's other ways to do it, including ncurses for the classic feel...
#19
Re: The First Program Language Conundrum
Posted 19 April 2012 - 09:14 AM
I liken it to learning French, Italian & Spanish - with the similar root how the hell does one know which word belongs to which.
I am currently reading
COMMON LISP: A Gentle Introduction to Symbolic Computation
Practical Common LISP
Also reading John McCarthy's articles / essays on LISP as well as other positive & negative critiques.
Will get The Land of LISP today.
Am avoiding anything Scheme related until I have a better idea of syntax and have practised a little with Common LISP so will put those books on hold for now.
As for the practical side I took the shortest route I could find - lispbox 0.7 !
Will have longer more useful articles soon. Thanks again and feel free to keep sharing!
#20
Re: The First Program Language Conundrum
Posted 19 April 2012 - 10:29 AM
#21
Re: The First Program Language Conundrum
Posted 19 April 2012 - 10:36 AM
His essays are useful, too, if you want to ratify your decision to study the ancient and noble art of paren-fu.
#22
Re: The First Program Language Conundrum
Posted 22 April 2012 - 07:42 AM
While I haven't given up on learning Java I have put it on the back burner. LISP however is slowly encroaching upon my entire life. It fascinates. This should be what everyone learns first. I see why they don't, the resources are spare confusing and conflicting. Just figuring out how to compile a file and which version to use is a nightmare. Regardless once the environment is worked out (and I am writing a brief introduction on how people can quickly begin with LISP) the language is intuitive, succinct and requires thought.
As at best a half-witted out dated programmer I only see surface beauty in much of these bits, I am sure the more experienced among you perceive things I don't yet conceive.
For those of you interested in what LISP code looks like and why it is practical in its elegance may I suggest reading:
Why I love Common Lisp and hate Java
P.S. I don't plan on commenting further on these boards but should any of you wish to natter LISP like with me feel free to contact me. Good luck to you all!
This post has been edited by Magooguli: 22 April 2012 - 07:44 AM
#23
Re: The First Program Language Conundrum
Posted 01 May 2012 - 10:08 AM
...In other words, I'd start with a project you want to get done- you probably already know which one you want to do, as you're reading this, and I whole-heartedly recommend trying it if it's relatively simple, in terms of what it needs to do and what it needs to know, as well as how it is intended to know that. If you can completely explain those three parts, the rest is just details, almost no matter what language you use.
#24
Re: The First Program Language Conundrum
Posted 30 July 2012 - 05:50 PM
#25
Re: The First Program Language Conundrum
Posted 30 July 2012 - 07:37 PM
Why? If it's such an amazing language why not solely focus on it?
Ruby is a level of abstraction all its own, and in order to really appreciate and comprehend its real power you need background in a lower language like C++ or C. So much of Ruby is simple to start out and run with, but if you want to really be proficient then C should be a required prerequisite.
Now what makes Ruby so good is its ability to monkeypatch and metaprogram. You don't like the way that strings are defaultly handled? Override it. Integers? Override it. Kernel, and Object itself? Not suggested but it's possible to override.
So what does this massive Object Oriented freedom give us? Metaprogramming. Call methods by their names with a string or symbol dynamically, call a method that doesn't even exist and override the method_missing handler to intercept them. Make singleton/eigenclasses that dynamically redefine a class for one object. Generate hundreds of threads dynamically!
The beauty of it has really captured me. Combine the raw power of Object Oriented with the elegance of Functional Programming and you have even more to wrap with.
Closures to dynamically warp scope, blocks lambdas and procs to make anonymous methods, and more that I haven't even begun to stumble upon. I apologize, but my Functional is rather weak as compared to my OO experience.
Here's an example of one of my favorite little toys in Ruby (using Windows):
def ping(ip)
return system "ping -n 1 -w 1000 #{ip} > NUL"
end
def hyperthread(method_name,ip,number)
threads = []
number.times do
threads << thread.new{method.call(method_name,ip)}
end
threads.each{|t| t.join}
end
I need to work out passing args more efficiently, but you get the general point of that. You can pass a method name to method.call and dynamically call a method inside a thread and generate multiple threads. The result of this? 50 pings in .68 seconds on an i7 with 8gB of RAM that can be looped. Stress test anyone?
I'm still thrilled to get into the functional aspects and really find some new toys to play with as I go along, but we'll see how that one goes.
Ruby is a great language for a seasoned vet, but a crutch for a newcomer.
This post has been edited by Lemur: 30 July 2012 - 07:37 PM
#26
Re: The First Program Language Conundrum
Posted 19 December 2012 - 12:12 AM
It teaches you how to handle all the low-level stuff, which makes it easier to understand how programs and systems work better (although I guess use C++ instead since it has the "new" function which is easier to understand than "malloc" I think, and other tiny bits that they add onto C).
Once you learn how the low-level stuff is handled (references vs memory data, etc), you can understand better higher-level stuff, like in java.
For instance, the whole "Does java let you pass parameters by reference?" question is pretty easily answered if you already know how references are handled in C and just think of java variables as "C references without the * ".
After you get past that point java makes things SO MUCH easier though. Seriously. I'd recommend learning it at one point or the other.
Haven't really used scripting languages other than Perl or octave for some computation classes. I guess they fulfill their purpose of being "easy" and "fast" to use in those environments.
If you just want to do some methodical computation or math operations and the like I'd recommend those scripting interpreted languages instead (haven't really seen a compiled scripting language before though).
I know it's like 100 times more hard to do, and would require a lot of previous design, but if you plan on doing more "advanced" systems with lots of interactions and the like but still want metaprogramming it could be done I think
#27
Re: The First Program Language Conundrum
Posted 19 December 2012 - 07:18 PM
Quote
not like in lisp, not even like in C++. Heck, C with it's macros has better meta programing capabilities than Java as far as I know. Java has reflection I suppose but that's not really metaprogramming.
#28
Re: The First Program Language Conundrum
Posted 19 December 2012 - 07:44 PM
ishkabible, on 19 December 2012 - 11:18 PM, said:
Quote
not like in lisp, not even like in C++. Heck, C with it's macros has better meta programing capabilities than Java as far as I know. Java has reflection I suppose but that's not really metaprogramming.
I know there are some APIs that let you:
1)Handle .class files and create/get byte-code or create new .class files with the byte-code and constants you want
2)Handle .class files using source code.
I don't remember which ones, but I do remember ones that allow you to create a class with it's methods/fields/etc from scratch using source code.
Again....is not that easy to use, specially not in the middle of a program
JavaAssist is one of them, dunno about the other one.
#29
Re: The First Program Language Conundrum
Posted 25 January 2013 - 11:37 AM
If a student who is starting to learn Java and gets confused and decides to try another language, not only is tha "normal" but should be deemed as a good thing.
C++ is a good language to go to next because it is very similar to Java.
I would also recommend you consider learning Python too.
I have never studied Lisp so I have no opinion about it.
|
|

New Topic/Question
Reply



MultiQuote











|