Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Its that time again (suggest a language)

Name: Anonymous 2007-04-26 3:48 ID:WgsXgi3d

What's the best language for a complete beginner to pick up and learn?

I'm able to read through sources in various languages and understand whats happening on a fundamental level.

I want to learn a language over the next 3~5 months and i cant make any informed desicions on which.

Suggest the language best suited to an entry level programmer.

IN BEFORE SHITSTORM

Name: Anonymous 2007-04-30 7:31 ID:0T1xdGUr

>>119
I guess you're some rabid piece of military personell that can't stand the carefree lazy attitude of sitting in a comfortable position either, So you have a 3 foot rebar welded to your chair so you can have a stabilizer put up your ass.

Name: Anonymous 2007-04-30 8:07 ID:FjFYxUBz

>>108
I don't understand why some people are so adamantly against typed variables.
Because I like my free time, I don't want to waste my time explaining the obvious, and I quack like a duck. Dynamic typing is this, everything works as long as it works. If you can apply a particular method/function to a particular object, then it's applied! Such an amazing concept, it deserves the nobel prize of obvious. Why would you want to put stones in your path and shoot your foot with stupid restrictions on how to do your work? It's not like you can screw up unless you're a terrible programmer and find ugly, ambiguous names for your methods/functions.

dynamic typing causes some errors to take a long time to be caught
Almost never had a problem with dynamic typing. I agree that automatic type conversion (as done in Perl or PHP with strings and numeric types, for example) is stupid and dangerous, but other languages are strong typed, yet dynamically typed. Objects have types, variables not, and there's ubiquitous polymorphism which means anything as long as it works, and naturally, only things that have been defined work.

What takes longer: catching a type error with a test case or during compilation?
Catching a pain in the ass of a bug once takes less time than having to define every stupid thing and wasting time thinking of type hierarchies and/or casting here and there.

Name: Anonymous 2007-04-30 9:08 ID:79UaK1BV

>>118
[code][/code]
:)

Name: Anonymous 2007-04-30 12:08 ID:scgqEpdV

Catching a pain in the ass of a bug once takes less time than having to define every stupid thing and wasting time thinking of type hierarchies and/or casting here and there.
I agree that hierarchies are a pain. I don't like them either.

I disagree with the other assertions though. I've worked on a large project with a dynamically-typed language, which is why I feel that such languages should be optionally-typed. Instead of catching the bug after a couple seconds (compile), it would take anywhere between ten to a hundred times longer (test cases). And sometimes such bugs slipped through anyway (incomplete test case) and were seen by customers.

That slowed down my dev cycle terribly, because such flaws were quite easy to make with the code I was working on.

Name: Anonymous 2007-04-30 12:11 ID:scgqEpdV

>>118
Someone will first have to explain to me what that does.

Name: Anonymous 2007-04-30 12:59 ID:whdQMUlC

>>125
It's a calculator domain-specific language. Here's the full code

[code]
data Term = Number Double
          | Inverse Term
          | Add Term Term
          | Mul Term Term

eval :: Term -> Double
eval (Number x) = x
eval (Inverse x) = 1 / x
eval (Add t1 t2) = eval t1 + eval t2
eval (Mul t1 t2) = eval t1 * eval t2
[code]

i.e.
*Main> eval $ Inverse (Add (Mul (Number 2) (Number 3)) (Number 2))
0.125

Name: ddddddddddddddddddddddddd 2007-04-30 13:17 ID:whdQMUlC

>>Because I like my free time,I don't want to waste my time explaining the obvious

that's why you're on 4chan rite? Cuz time is moneys.

AUTOMATIC TYPE INFERENCE. Have you heard of it? It's the novel concept that--holy shit--the compiler figures out the types for you! That way, you never have to write the types of functions or variables in your code, but the compiler still catches stuff like sin("DESU"), which would be a-okay in a web-developer language such as the one you use.

Prelude> :t 1
1 :: (Num t) => t
Prelude> :t \x -> x + 1
\x -> x + 1 :: (Num a) => a -> a
Prelude> :t \x -> x ++ x
\x -> x ++ x :: [a] -> [a]
Prelude> :t foldr
foldr :: (a -> b -> b) -> b -> [a] -> b
Prelude> :t \x -> putStr x
\x -> putStr x :: String -> IO ()
Prelude> :t \x -> (putStr . show) x
\x -> (putStr . show) x :: (Show a) => a -> IO ()

Name: Anonymous 2007-04-30 13:24 ID:79UaK1BV

>>126
Sir, that is not a "DSL"
THIS!!! is a DSL:

(defun null. (x)
  (eq x '()))

(defun and. (x y)
  (cond (x (cond (y 't) ('t '())))
        ('t '())))

(defun not. (x)
  (cond (x '())
        ('t 't)))

(defun append. (x y)
  (cond ((null. x) y)
        ('t (cons (car x) (append. (cdr x) y)))))

(defun list. (x y)
  (cons x (cons y '())))

(defun pair. (x y)
  (cond ((and. (null. x) (null. y)) '())
        ((and. (not. (atom x)) (not. (atom y)))
         (cons (list. (car x) (car y))
               (pair. (cdr x) (cdr y))))))

(defun assoc. (x y)
  (cond ((eq (caar y) x) (cadar y))
        ('t (assoc. x (cdr y)))))

(defun eval. (e a)
  (cond
    ((atom e) (assoc. e a))
    ((atom (car e))
     (cond
       ((eq (car e) 'quote) (cadr e))
       ((eq (car e) 'atom)  (atom   (eval. (cadr e) a)))
       ((eq (car e) 'eq)    (eq     (eval. (cadr e) a)
                                    (eval. (caddr e) a)))
       ((eq (car e) 'car)   (car    (eval. (cadr e) a)))
       ((eq (car e) 'cdr)   (cdr    (eval. (cadr e) a)))
       ((eq (car e) 'cons)  (cons   (eval. (cadr e) a)
                                    (eval. (caddr e) a)))
       ((eq (car e) 'cond)  (evcon. (cdr e) a))
       ('t (eval. (cons (assoc. (car e) a)
                        (cdr e))
                  a))))
    ((eq (caar e) 'label)
     (eval. (cons (caddar e) (cdr e))
            (cons (list. (cadar e) (car e)) a)))
    ((eq (caar e) 'lambda)
     (eval. (caddar e)
            (append. (pair. (cadar e) (evlis. (cdr e) a))
                     a)))))

(defun evcon. (c a)
  (cond ((eval. (caar c) a)
         (eval. (cadar c) a))
        ('t (evcon. (cdr c) a))))

(defun evlis. (m a)
  (cond ((null. m) '())
        ('t (cons (eval.  (car m) a)
                  (evlis. (cdr m) a)))))

Name: Anonymous 2007-04-30 13:34 ID:/49XgMPp

>>128
What does this have to do with the topic? Or is this just your way to say "I've read SICP"?

Name: Anonymous 2007-04-30 14:11 ID:scgqEpdV

>>126
Hmm, that's interesting. I'm not sure what that has to do with dynamically- versus statically-typed though.

sub Number($x)    { $x }
sub Inverse($x)   { 1/$x }
sub Add($t1, $t2) { $t1 + $t2 }
sub Mul($t1, $t2) { $t1 * $t2 }


Result:

pugs> Inverse(Add(Mul(Number 2), (Number 3)), (Number 2))
1/8


Have I misunderstood something?

Name: Anonymous 2007-04-30 14:28 ID:Heaven

>>130
He meant that the part Inverse (Add (Mul (Number 2) (Number 3)) (Number 2)) is a value, which is passed to the function eval, which recursively evaluates it.

Name: Anonymous 2007-04-30 15:19 ID:scgqEpdV

Fair enough. Try no.2:

sub Number($x)              { $x }
sub Inverse($x)             { 1 / $x }
sub Add(lazy $t1, lazy $t2) { $t1 + $t2 }
sub Mul(lazy $t1, lazy $t2) { $t1 * $t2 }

Name: Anonymous 2007-04-30 15:22 ID:Heaven

sub Inverse(lazy $x)        { 1 / $x }
fix'd

Name: Anonymous 2007-04-30 16:37 ID:Heaven

That code sucks, though. You could have easily included at least the words `convergence' and `assimilation' in it.

Name: Anonymous 2007-04-30 16:42 ID:79UaK1BV

>>130
hay I gno lets use haskell its easy to write "DSL" - DOMAIN SPECIFIC LISPS!

Name: Anonymous 2007-04-30 16:55 ID:scgqEpdV

>>134
I admit it's not pretty; it's full of noise. That's Perl for you.

I'm just pointing out that there's no inherent reason why a dynamically-typed language can't do the same. I am convinced that statically-typed languages can at best (with inference, pattern matching, and the like) match dynamically-typed languages for expressiveness and terseness, and that it rarely happens in practice. Is there any feature that statically-typed languages have that dynamically-typed cannot incorporate well? Multimethods maybe?

That's ignoring the problems with dynamic typing though, which drive me batshit sometimes, and the ruby/python apologists don't help. I really hope optional typing becomes the norm one day, because I want the best of both worlds.

However, if anybody can point otherwise, I'd be happy to learn.

Name: Anonymous 2007-04-30 17:24 ID:/49XgMPp

>>136
YHBT. Someone copypastaed my post from another thread.

Totally unrelated to that, I don't believe there's anything statically typed languages can do that dynamically typed can't (after all, all they do is to place additional restrictions on what you can do). The whole point of static typing (as I understand) is that you can prove a larger part of the correctness of your program at compile time - which is a really, really good thing, as far as I can tell.

Name: Anonymous 2007-04-30 17:28 ID:79UaK1BV

could someone possibly write up or link to a convicing draft on why strong typing is important and type-safe dynamic languages are horrrible?

I really dont feel what you people are saying, but id like to understand where you are coming from.

Name: Anonymous 2007-04-30 17:57 ID:scgqEpdV

on why strong typing is important and type-safe dynamic languages
A type-safe dynamically-typed language is a strongly-typed language. Likewise for statically-typed: ML is a strongly-typed, while C is quite weak. Just ask yourself how easy it is to subvert the type system.

Anyway, the topic has been beaten to death elsewhere. This looks like the mother of all debates: http://groups.google.com/group/comp.object/browse_thread/thread/8802fe2212b159e1/061002028460c17e?tvc=2&q=static+dynamic+typing+versus#061002028460c17e

tl;dr: each has its strengths and weaknesses

Name: Anonymous 2007-04-30 18:01 ID:Heaven

>>138
I don't think anything or anyone can convince you, but I'm writing what happened to me.

I wasted almost ten years writing C, and got pretty good with it. I also made the mistake of thinking that this is pretty much all there is to programming. Then I read SICP and understood I sucked. Period.

I started heavily using Lisp, Ruby (years before it became big outside Japan, mind it) and a few years later replacing the latter with Python for purely practical reasons (more users -> more libraries -> less work for me, also, too bad Ruby *really is* slow as fuck compared to even Python). All this time I naturally had to write some C to support whatever I was doing. Also, Java, C++. They sucked very badly and still do, and I want them to go away.

I wasn't having very much problems with what I was using, or so I thought, after all, I used unit testing, wrote functional, clear code whenever possible and otherwise avoided all kinds of asshattery.

Then I found out about Haskell. Or not really ``found out about''; more like I had read enough blog entries about it and wanted to say ``fuck you idiots, Lisp has been around for 40 years and you're reinventing the wheel without noticing'' or something like that.

When I started learning about Haskell, I immediately recognized two things: it's *purely* functional, which was completely new for me (but turned out to be a very good idea), and it was statically typed, but this time static typing didn't mean spelling out the obvious for the compiler but having the compiler spell out the obvious for me before I tried to make my objects quack, just to understand they don't even have a fucking mouth. I also understood that it would solve a large subset of the problems I'd had with Lisp and Python.

Alone, even static typing with type inference would be very restricting. What makes it shine is:

- The lack of effort needed to create new data types
- Type classes and generalized types, which give me almost all of the shut-the-fuck-up-and-just-do-what-I-mean properties of dynamic typing (with no extra work!) and compile-time type safety, which means that my variables are guaranteed to quack the right way when I want them to

I've not turned into a static typing fanboy, but right now I see properly implemented static typing as a HUGE improvement over any kind of dynamic typing.

Name: Anonymous 2007-04-30 18:35 ID:Heaven

This has nothing to do with this topic, >>140, but please listen to me! I wasted almost ten years writing C, and got pretty good with it. I also made the mistake of thinking that this is pretty much all there is to programming. Then I read SICP and understood I sucked. Period.

I started heavily using Lisp, Ruby (years before it became big outside Japan, mind it) and a few years later replacing the latter with Python for purely practical reasons (more users -> more libraries -> less work for me, also, too bad Ruby *really is* slow as fuck compared to even Python). All this time I naturally had to write some C to support whatever I was doing. Also, Java, C++. They sucked very badly and still do, and I want them to go away. I wasn't having very much problems with what I was using, or so I thought, after all, I used unit testing, wrote functional, clear code whenever possible and otherwise avoided all kinds of asshattery.

Then I found out about Haskell. Or not really ``found out about''; more like I had read enough blog entries about it and wanted to say ``fuck you idiots, Lisp has been around for 40 years and you're reinventing the wheel without noticing'' or something like that.

When I started learning about Haskell, I immediately recognized two things: it's *purely* functional, which was completely new for me (but turned out to be a very good idea), and it was statically typed, but this time static typing didn't mean spelling out the obvious for the compiler but having the compiler spell out the obvious for me before I tried to make my objects quack, just to understand they don't even have a fucking mouth. I also understood that it would solve a large subset of the problems I'd had with Lisp and Python. Alone, even static typing with type inference would be very restricting. What makes it shine is:

- The lack of effort needed to create new data types
- Type classes and generalized types, which give me almost all of the shut-the-fuck-up-and-just-do-what-I-mean properties of dynamic typing (with no extra work!) and compile-time type safety, which means that my variables are guaranteed to quack the right way when I want them to. I've not turned into a static typing fanboy, but right now I see properly implemented static typing as a HUGE improvement over any kind of dynamic typing.

And that's why you, >>140, should stick with today's special.

Name: Anonymous 2007-04-30 18:35 ID:Heaven

This has nothing to do with this topic, >>140, but please listen to me! I wasted almost ten years writing C, and got pretty good with it. I also made the mistake of thinking that this is pretty much all there is to programming. Then I read SICP and understood I sucked. Period.

I started heavily using Lisp, Ruby (years before it became big outside Japan, mind it) and a few years later replacing the latter with Python for purely practical reasons (more users -> more libraries -> less work for me, also, too bad Ruby *really is* slow as fuck compared to even Python). All this time I naturally had to write some C to support whatever I was doing. Also, Java, C++. They sucked very badly and still do, and I want them to go away. I wasn't having very much problems with what I was using, or so I thought, after all, I used unit testing, wrote functional, clear code whenever possible and otherwise avoided all kinds of asshattery.

Then I found out about Haskell. Or not really ``found out about''; more like I had read enough blog entries about it and wanted to say ``fuck you idiots, Lisp has been around for 40 years and you're reinventing the wheel without noticing'' or something like that.

When I started learning about Haskell, I immediately recognized two things: it's *purely* functional, which was completely new for me (but turned out to be a very good idea), and it was statically typed, but this time static typing didn't mean spelling out the obvious for the compiler but having the compiler spell out the obvious for me before I tried to make my objects quack, just to understand they don't even have a fucking mouth. I also understood that it would solve a large subset of the problems I'd had with Lisp and Python. Alone, even static typing with type inference would be very restricting. What makes it shine is: - The lack of effort needed to create new data types - Type classes and generalized types, which give me almost all of the shut-the-fuck-up-and-just-do-what-I-mean properties of dynamic typing (with no extra work!) and compile-time type safety, which means that my variables are guaranteed to quack the right way when I want them to. I've not turned into a static typing fanboy, but right now I see properly implemented static typing as a HUGE improvement over any kind of dynamic typing.

And that's why you, >>140, should stick with today's special.

Name: Anonymous 2007-04-30 18:37 ID:Heaven

>>141
Well, what's today's special?

Name: Anonymous 2007-04-30 18:52 ID:/49XgMPp

>>1400000
When I started learning aboutside Japand-just-do-wheel without notically typed, Japan, minking that thistake of thinking (with now I so I thous for me befor 40 years and to writ all there is to programming aboy, but turned or so I thon. Alog entries fuck clear the compiler but problems with what-I-mean pround for 40 years writing very much problems with what It. I also und you'really ``found out to be a very generalized static types - The lack you idiots, Lis time static turning about Haskell. Or not turned into a few years lately new functional, which wasses and otherwisp and Python. I also understood I suckell. Or not to understand they don't even have whenever post all of as a HUGE I nattery.

Fixed.

Name: Anonymous 2007-04-30 18:55 ID:Heaven

>>144
I also understood I suckell.

Name: Anonymous 2007-04-30 19:52 ID:79UaK1BV

>>139
This is not the question I asked, or the topic of discussion

>>140
Youve given me the motivation to use haskell again for some future project, seems like its possible for people not to become haskell-fagboy static-typing faggots.
also, one question, is that even relevant to the topic, or is it just your (long winded) way of saying "Ive read SICP"?

Name: Anonymous 2007-04-30 21:00 ID:scgqEpdV

This is not the question I asked
I was pointing out that your terminology was wrong. It's "static" typing, not "strong" typing. There's a difference between the two. As for the answer to your question, read the linked thread.

What, you wanted a simple answer? Static/dynamic has been debated for decades, man.

or the topic of discussion
a) Then don't ask an off-topic question.
b) Who gives a shit about where you want the discussion to go, Mr. Wanna B. Mod.

Name: Anonymous 2007-04-30 23:31 ID:BI/6iiVh

off topic? this isnt yahoo groups bitch. this is 4chan!!!!

wut were we talking about?

Name: Anonymous 2007-04-30 23:52 ID:PpKBQTtJ

>>148
Whether or not you've read SICP.

Name: Anonymous 2007-05-01 2:02 ID:6cuu7SYs

>>type-safe dynamic languages

aha! contradiction!

Name: Anonymous 2007-05-01 3:45 ID:2NfrBZzL

I read a bit of SICP and got bored.

Name: Anonymous 2007-05-01 4:33 ID:YzJAlI8x

>>150
its not a contradiction, try reading SICP like I have and you will see.

Name: Anonymous 2007-05-01 12:36 ID:6cuu7SYs

>>152
I have read SICP and concluded that it sucks.

Name: Anonymous 2007-05-01 12:37 ID:YzJAlI8x

>>153
Is that even relevant to the topic or is it just your way of saying "Ive read SICP"?
also, NO NO U U LIE SICP RULES

Name: Anonymous 2007-05-01 15:04 ID:6cuu7SYs

>>154
no SICP sucks. TAPL (Types and Programming Languages, B. Pierce) RULES

Name: Anonymous 2007-05-01 15:10 ID:YzJAlI8x

>>155
hm funny because im reading that and I like SICP more so far.

Name: Anonymous 2007-05-01 16:23 ID:wm8Q5AY6

assert SICP > x for x in Universe

This operation obviously requires a dynamic language where you can compare SICP to x regardless of the type of x.

Name: Anonymous 2007-05-02 1:13 ID:LfoRI6Al

>>157
Assertion failed for x == SICP

Name: Anonymous 2007-05-02 3:02 ID:sW1zU0Kn

>>158
also for x==*(void*)0

Name: Anonymous 2007-05-02 3:08 ID:ju+BRop4

>>157
Except not all things can be compared, and you'll get a runtime exception when running your nucluar power planet.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List