Listen brahs. I have a dirty anus that needs cleaning: Java. I learned Java as my first language in school and now that I learned Scheme and am learning Haskell, I figured I may as well not let that go to waste and learn Scala. Is it simple to go from Java to Scala? Or is the syntax strange in some places. Because I looked over some code snippets and it seemed decent.
SON OF A BITCH SCALA
I AM JAVA
SCALA IS PIG
DO YOU WANT HIGHER-ORDER FUNCTIONS?
DO YOU WANT CURRYING?
MULTI-PARADIGM IS PIG DISGUSTING
YOUR ANUS IS A MURDERER
FUCKING HIPSTERS
Scala has one of the worst syntaxes i have ever seen.
It's as bad as java's but a different kind of bad, so you don't even have the advantage of familiarity like with c#.
There are too many ways to express the same thing, which leads to visual ambiguity, and it doesn't even look particularly nice:
(foo bar baz foobar), does it mean (foo.bar.baz.foobar) or (foo.bar(baz).foobar) or (foo.bar.baz(foobar)) ...
Indexing of data structures is done with parentheses instead of square brackets which neither makes it more readable nor more regular.
Type signatures are as ugly as it gets.
compare this:
Int -> Int -> Int
product x y = x * y
vs
def product(x: Int, y: Int): Int = {
x * y
}
an ugly cluttered fucking mess.
(I know in this example you could leave out the braces but sometimes you can't and the "): Int = {" part is so fucking ugly it makes me puke.)
Then there's the whole braces vs parens thing. Not sure how exactly it works but sometimes it seems you can just use whichever you prefer which is greatly annoying when you read someone else's code.
Then there's automatic semicolon insertion fuck automatic semicolon insertion .
etc.
Name:
Anonymous2011-04-18 10:52
http://en.wikipedia.org/wiki/Scala Typing discipline static
For me, the word "static" associates with: conservativity, spongers from academia, type theory, OOP, inconvenience, top-down nightmare, traditional pseudoscience, complicated religion, design patterns, 1984, jewish mathematics, verbose ugliness, planned overengineering.
Name:
Anonymous2011-04-18 11:22
OP here. Well, I mean, Haskell's polymorphic static typing and type classes are amazing. It sounds like I'd be better off with Haskell than Scala.
Name:
Anonymous2011-04-18 11:23
Well, Scala is still workable. At least its not perl.
>>5 GO FUCK A JEW, COCK SUCKING FAGGOT. I REALLY HATE YOU I
Name:
Anonymous2011-04-18 11:30
>>8
And everybody else went and chased static. And they've been doing it like crazy. And they've, in my opinion, reached the theoretical bounds of what they can deliver, and it has FAILED. These static type systems, they're WRONG. Wrong in the sense that when you try to do something, and they say: No, category theory doesn't allow that, because it's not elegant... Hey man: who's wrong? The person who's trying to write the program, or the type system?
>>10
Monad is just one of typeclasses. And a typeclass is some abstract entity, that allows concrete types to use some functions. And the nature of these functions depends on a typeclass of a concrete type, and how these functions implemented for a concrete type depends on the embodiment of the typeclass of that type. For example, monad Maybe is a type, computations, embedded into a monad of which, return either result, embedded into one of its data constructors, or a second data constructor - Nothing. Naturally, abstract types are often implemented in terms of type-class constrained polytypes and extraction functions from/to the abstract type families of polymorphic functions to/from some concrete type. However, the definitional structure of an abstract type uses interface operators and, therefore, is not affected by changes of representation. which may be logically hidden and, sometimes, even physically unavailable.
>>15
More to the point, you don't seem capable of being clear and concise. Maybe you should stick to doing something easier. Like talking about your anus.
Oh look. I can't get a run in my tights because they are actually black leggings.
Name:
Anonymous2011-04-18 12:01
>>30
This shabbos goy can't stand it, when I insult his jewish masters.
Name:
Anonymous2011-04-18 12:06
Jewish mathematician found refuge for his groundbreaking work on infinities in, of all places, the Roman Catholic Church... Catholic theologians welcomed Cantor's ideas, which provided a workable way of understanding mathematical infinities, as evidence that humans could grasp the infinite and could also, therefore, have a greater understanding of God, himself infinite.
Name:
Anonymous2011-04-18 12:10
>>9
Bro you can write decent programs. Its fine >>11
This
Because duck typing is clearly better and doesn't call its own bugs, right? As long as its strong typing, it'll work. Get over it
>>35
``Duck typing'' is just the bastardized Phytonic version of proper (Smalltalk's) message passing.
Python fails both at ``duck typing'' and dynamic typing. Don't use it as example of properly dynamic typed language.
Name:
Anonymous2011-04-18 12:18
>>36
Lol. I know. I just love Haskell's typing system. Very comprehensive. Also, the language, like most impure and pure functional languages, is good for teaching/learning math. Duck typing is for the jewish who can't be bothered to make code clean and less error-free
>>38
Only if you can't use it well. And besides, polymorphism takes care of the bugs. No system is "perfect". The idea of "good enough" or "great but not perfect" if used well pervades all of Comp Sci. Deal with it.
Name:
Anonymous2011-04-18 12:21
>>38
What do you expect from a language whose type system, as defined in the original report, was meant to act as a bridge between....
Name:
Anonymous2011-04-18 12:22
I decided to stop torturing myself and part with Haskell. Why I did that?1st I don't give a damn about its type system and Haskell was putting it in my throat.2nd I didn't learned anything new. Well beside bunch of tricks, and I wasn't looking for tricks.
Farewell Haskell, you're joining the company of languages that didn't taught me much about programming nor changed the way I'm thinking .As Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing". The rest of the crew consists of pascal, basic, delphi, php, c#, ocaml, python and sql.
Name:
Anonymous2011-04-18 12:23
I can pinpoint the exact page in Real World Haskell where I became lost. I was reading along surprisingly well until page 156, upon introduction of newtype.
At that my point my smug grin became a panicked grimace. The next dozen pages were an insane downward spiral into the dark labyrinth of Haskell's type system. I had just barely kept data and class and friends straight in my mind. type I managed to ignore completely. newtype was the straw that broke the camel's back.
As a general rule, Haskell syntax is incredibly impenetrable. => vs. -> vs. <-? I have yet to reach the chapter dealing with >>=. The index tells me I can look forward to such wonders as >>? and ==> and <|>. Who in their right mind thought up the operator named .&.? The language looks like Japanese emoticons run amuck. If and when I reach the \(^.^)/ operator I'm calling it a day.
>>44
It's better than Java, but just stick to Scheme/Haskell.
Name:
Anonymous2011-04-18 12:27
As with pretty much any given functional programming language, things are so unintuitive that, well, I can't even explain properly how BAD things are. I'm studying haskell for college and I must say, when I compare the things I can do with C (I can even use pointers well), Java (I solve problems with classes), Python (I solve problems in simpler ways than C or Java) and even Shell Scripts (and that's something!) with Haskell (I pretty much can't do a thing), I know something must have gone terribly wrong!
Haskell is a bit of a fiddly language, much more primitive than most I tend to work with no implementation of while or for loops. And also lacking the ability to use functions as variables (again, primitive language) means I can not easily implement one myself, you simply have to recall the local function from inside itself … It makes me feel … Like a caveman. Anyway. I’ve also got to pick up C# at some point … Super exciting no doubt … but i’m weeks behind.
Name:
OP2011-04-18 12:28
>>42
I might use Haskell as my main language but I agree with everything else. Honestly, you have to learn radically different languages to learn something. Seven Languages in Seven Weeks taught me that. >>42
Once you know the operators though, as long as you know what you want, the type system is damn intuitive. But for some people, its not a right fit because they think of things as they program. And that's cool too. Just don't use java. Or you are a murderer
>>46 It's something I'm not used to, it must be bad!
Name:
OP2011-04-18 12:30
>>48 >>46
Its not primitive and you can use anonymous functions and assign them to variables. And use higher order functions. So I have no idea what the fuck you are talking about. BUt if you don't like it, I honestly don't care. It has a large community of people that like it for a reason. And fuck C#
Name:
Anonymous2011-04-18 12:32
>>50
He used to JAVA, and Haskell is pretty much like JAVA (statically typed, set theory based). This means that Haskell isn't much better than JAVA for solving his problems.
>>55
What profit in this "pure functional language" buzzword?
Name:
Anonymous2011-04-18 12:36
>>56
Recursive anonymous functions? I wish I'd thought of that. Oh wait. I did. Expand that concept to include whole modules? Recursive modules? Oh that's right.
-- shortcuts
type One = Succ Zero
type Two = Succ One
type Three = Succ Two
type Four = Succ Three
-- example list
list1 :: Cons Three (Cons Two (Cons Four (Cons One Nil)))
list1 = undefined
-- utilities
numPred :: Succ a -> a
numPred = const undefined
class Number a where
numValue :: a -> Int
instance Number Zero where
numValue = const 0
instance Number x => Number (Succ x) where
numValue x = numValue (numPred x) + 1
numlHead :: Cons a b -> a
numlHead = const undefined
numlTail :: Cons a b -> b
numlTail = const undefined
class NumList l where
listValue :: l -> [Int]
instance NumList Nil where
listValue = const []
instance (Number x, NumList xs) => NumList (Cons x xs) where
listValue l = numValue (numlHead l) : listValue (numlTail l)
-- comparisons
data Less
data Equal
data Greater
class Cmp x y c | x y -> c
instance Cmp Zero Zero Equal
instance Cmp Zero (Succ x) Less
instance Cmp (Succ x) Zero Greater
instance Cmp x y c => Cmp (Succ x) (Succ y) c
-- put a value into one of three lists according to a pivot element
class Pick c x ls eqs gs ls' eqs' gs' | c x ls eqs gs -> ls' eqs' gs'
instance Pick Less x ls eqs gs (Cons x ls) eqs gs
instance Pick Equal x ls eqs gs ls (Cons x eqs) gs
instance Pick Greater x ls eqs gs ls eqs (Cons x gs)
-- split a list into three parts according to a pivot element
class Split n xs ls eqs gs | n xs -> ls eqs gs
instance Split n Nil Nil Nil Nil
instance (Split n xs ls' eqs' gs',
Cmp x n c,
Pick c x ls' eqs' gs' ls eqs gs) =>
Split n (Cons x xs) ls eqs gs
>>85
So you can reimplement the same syntax that Haskell already has with Map? What a murdered of anuses. I went through SICP using Haskell >>148
That's an overly literate version of Haskell's typical quicksort