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

Pages: 1-

Dynamic language

Name: Anonymous 2012-11-06 4:54

http://ro-che.info/ccc/images/typing.png

When do you ever need dynamism? When do you ever need monkey-patching, eval, heterogeneous collections, and shit like this?

Name: Anonymous 2012-11-06 5:49

>>1
>>http://ro-che.info/ccc/images/typing.png
back to the imageboards please

Name: LISPPER 2012-11-06 6:29

>>1
monkey-patching
Almost never.

eval
Almost never.

heterogeneous collections
A lot more often than you think.

and shit like this
I suppose this includes not having to spend time on typing type signatures.

Name: Anonymous 2012-11-06 6:54

The guarantees that common static typing gives are so weak that you still need real verification for anything useful.
To take an example from Haskell's Prelude, gcd and lcd are quite different, but both have the type (Integral a) => a -> a -> a.

Common static typing also uses the approach of accepting only what it can easily prove to be correct, instead of rejecting what can be proven incorrect. As an example, take the Y combinator $\f -> (\x -> f (x x)) (\x -> (f (x x)))$. Without guidance, Haskell's type checker just gives up and tells you to go fuck yourself. In light of my first point it is not worth the effort to provide this guidance; the type system works against you instead of with you.

I find type systems only useful when they can prove non-trivial properties (e.g. Coq) or don't interfere (e.g. SBCL style warnings). Other type systems are more hindrance than help.

Name: Anonymous 2012-11-06 6:55

I have been applying for a Python job once, and the interviewer asked if I knew what was [w() if type(w) is type else w for w in ws].  He appeared very surprised when I swiftly decoded the expression and correctly guessed its alleged function (apparently most people who applied to the same job were unable to understand such simple expression).  This is the only time ever I saw a real need to taint my mind with a heterogeneous collection.

Name: Anonymous 2012-11-06 6:57

When do you ever need dynamism?

Symta:

f !?.??+1 [ø@X]


Haskell:

module Main
where

import List
import Control.Arrow

type Comparator a = (a -> a -> Ordering)

ascending :: (Ord a) => (b -> a) -> Comparator b
ascending f x y = compare (f x) (f y)

descending :: (Ord a) => (b -> a) -> Comparator b
descending = flip . ascending

secondary :: Comparator a -> Comparator a -> Comparator a
secondary f g x y = case f x y of {
                    EQ -> g x y;
                    z  -> z; }

-- Returns a list of unique elements together with their frequency. Listed in decreasing order of frequency, followed by
increasing order of the elements.
count :: (Ord a) => [a] -> [(a, Int)]
count = map (head &&& length) . sortBy (descending length `secondary` ascending head) . group . sort

main :: IO ()
main = interact $ unlines . map (\(x, y) -> (take 20 $ x ++ repeat ' ')  ++ " : " ++ show y) . count . words

Name: Anonymous 2012-11-06 7:00

>>6

f ø !?.??+1 X


self fix.

Name: Anonymous 2012-11-06 8:21

OP here. You really got me thinking /prog/. I don't know what to think of it all.

Name: Anonymous 2012-11-06 8:48

>>6
What's the grammar, supposedly, for your shit?

Name: Anonymous 2012-11-06 8:51

>>1
I think the circle representing those who understand type theory, should be a lot smaller than the other two.

Name: Anonymous 2012-11-06 10:19

>>6,7
Fuck off Shitta fagstorm

Name: Anonymous 2012-11-06 10:39

>>1
sets
Shalom!

Name: Anonymous 2012-11-06 13:19

>type theory
stop reading right there, ``faggot''

Name: Anonymous 2012-11-06 14:00

>>11
Shalom, Chaim!

Name: Anonymous 2012-11-06 14:05

>>14
is symta arabic or what

Name: Anonymous 2012-11-06 19:53

>>3
Malaised by Monkey patching?
Eschew Eval?
Need Vectors of Variants?
Sick of Signatures?
Try an ML today!

Name: Randall 2012-11-06 20:05

Great image, OP. Made me LOL :-)

Name: Anonymous 2012-11-06 20:22

>>16
Is there an ML with s-expressions?

Name: Anonymous 2012-11-06 21:33

>>18
Not afaik, but you can put parens around just about everything and it will look right. Curried syntax is nicer imo.

Name: Anonymous 2012-11-06 21:43

>>19
Scheme: (curry f arg...)?

Name: Anonymous 2012-11-06 23:35

>>20
OCaml:
let f x y = x + y in (* for the sake of example *)
f 1;;
- : int -> int = <fun>


Or equivalently:

(+) 1;; (* treat `+` as a function *)

Since everything has specific arity it is able to curry implicitly. Trivia: Haskell was named after the (re-)discoverer of this method, Haskell Curry.

Name: Anonymous 2012-11-07 1:03

>>21
Algol 68 almost had expressions like (+)(1,) using "operator base" and "partial application" but there was never a Revised Revised Report so these were just proposed extensions. Algol 68 was an expression-oriented garbage-collected multi-threaded language. Any type can be anonymous including functions, structures, unions, references, and arrays. Some of the other things it almost had were case on ranges and subtypes, modals (type variables/generics), deuniting (implicitly extracting values from unions), record transfer (persistent mass storage), inductive types (e.g. mode list = (mode x)union(void, struct(x car, list(x) cdr))), a composable module system (like ML structures and functors), restartable exceptions, lazy parameters, and collecting loop expressions (like array comprehensions). The Revised Revised Report would have been decades ahead of many languages today.

Name: Anonymous 2012-11-07 3:15

Holy shit 1968.

Name: Anonymous 2012-11-07 17:10

>>22
It's a shame how limited the sense of "Algol Family" is today.

Name: Anonymous 2012-11-07 18:30

Dynamic typing is the best one for modern software. This is a big reason for Javascript's elegance.

Name: Anonymous 2012-11-07 18:34

>>25
Holy crap, the Javashit troll learned to capitalize properly.

Name: Anonymous 2012-11-07 19:22

Can someone give me the tl;dr of type theory?

Name: Anonymous 2012-11-07 20:15

>>22
tl,dr: Any useful features the ML family had were already in Algol. Therefore, static typing is not real.

Name: Anonymous 2012-11-07 20:29

>>27
type theory is typical useless mathematical wankery.

Name: Anonymous 2012-11-07 21:33

>>29
Annnnnd we've come full circlejerk.

Name: Anonymous 2012-11-07 22:21

>>27
http://en.wikipedia.org/wiki/Type_theory

>>23
Yeah, now you know about all the jokes made about 1968-69, Niklaus Wirth, ALGOL W, and other shit. Actually, go read it:
http://en.wikipedia.org/wiki/ALGOL_68

>>24
It's alive in C and Pascal.

Name: Anonymous 2012-11-09 11:34

>>33
Nice dubs, bro!

Name: Anonymous 2012-11-09 13:14

>>21
That syntax is a misfeature. Any time you refer to built-in operators, it should be by function name instead of special syntax. Otherwise it's not explicit what you're doing.

>>32
What do you think this is? ALGOL 66? Get lost.

Name: Anonymous 2012-11-09 13:30

>>33
Nice dubs!

Name: Anonymous 2012-11-09 13:55

>>18
you could use racket(scheme) with types macro.

Name: 2012-11-10 6:33


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