tag:blogger.com,1999:blog-11788780.post6837984416453603291..comments2023-12-29T13:22:33.104-08:00Comments on JJinuxLand: Haskell: Well-typed Programs Can't be Blamedjjinuxhttp://www.blogger.com/profile/03270879497119114175noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-11788780.post-83268177473716405802008-01-15T11:45:00.000-08:002008-01-15T11:45:00.000-08:00> I know nothing about Haskell, is it a language a...> I know nothing about Haskell, is it a language as powerful thus intelligent as Lisp?<BR/><BR/>I always like to joke that Haskell makes Lisp look like an imperative language in comparison ;)<BR/><BR/>> Or is it close to C language (the language that is developed for UNIX system)?<BR/><BR/>It's nothing like C.<BR/><BR/>> I think C++ has so many features inside the language and it give the programmer too many choices, that may not be good.<BR/><BR/>I know what you mean.<BR/><BR/>I think gobject is definitely interesting. I first did OO C programming in GTK. I prefer C over C++ too.jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-20991472540036399332008-01-15T11:39:00.000-08:002008-01-15T11:39:00.000-08:00Wolf, thanks for your comments.> ‘‘i want to have ...Wolf, thanks for your comments.<BR/><BR/>> ‘‘i want to have an iterable here’’<BR/><BR/>That's what interfaces are for in Java.<BR/><BR/>> ‘‘must be an iterable of numbers’’<BR/><BR/>Yeah, that wasn't possible until generics.<BR/><BR/>> ‘‘must be an iterable of numbers between 0 and 12’’<BR/><BR/>That's probably still not possible without creating a new class that can only store such numbers.<BR/><BR/>> and the braindead distinction between ‘‘integers as such and integers as objects’’<BR/><BR/>I do like the fact that everything's an object in Ruby and Python.<BR/><BR/>> it is imho not so much static typing per se<BR/><BR/>I'm not against static typing, as long as you give me a language with an ML type system ;)<BR/><BR/>> python, on the other hand, has too few built-in type assertions<BR/><BR/>I'm going to have to disagree with you there ;)<BR/><BR/>> ','.join( value for value in values)<BR/><BR/>That's easier written ','.join(values)<BR/><BR/>> this will fail if on of the values is not already a text, so you need an iterable of texts, which you can not succinctly express in that language.<BR/><BR/>I beg to disagree: ','.join(map(str, values))<BR/><BR/>> that will never be as strict or reliable as in java (something that i can live with).<BR/><BR/>Python's type checking is just as reliable as Java's. It's just that it's done at runtime (using duck typing) rather than at compile time.jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-51664120840303373342008-01-15T08:17:00.000-08:002008-01-15T08:17:00.000-08:00I know nothing about Haskell, is it a language as ...I know nothing about Haskell, is it a language as powerful thus intelligent as Lisp? Or is it close to C language (the language that is developed for UNIX system)?<BR/><BR/>I start programming with C++, but now my favoriate is C, I think C++ has so many features inside the language and it give the programmer too many choices, that may not be good. On the other hand I like the simplicity of C, last year I did a project with gstreamer, gstreamer is developed based on GOBJECT model (OO on C language). I have an impression on how easy to develop a gstreamer plugin with my C/C++ knowledge, even I know nothing about GOBJECT, I can complete the project easily. The architecture of gstreamer is well established by GOJBECT, so I think I would learn how to programming with GObject this year, to learn how gstreamer is established.Markhttps://www.blogger.com/profile/06084095748729100227noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-76021997862983880422008-01-15T05:05:00.000-08:002008-01-15T05:05:00.000-08:00thx 4 the thoughts. guess one problem with java’s ...thx 4 the thoughts. guess one problem with java’s way of doing static typing is that it (to my understanding and in the absence of generics, which it now does have) never used to allow you to say simple things like ‘‘i want to have an iterable here’’, or ‘‘must be an iterable of numbers’’, or ‘‘must be an iterable of numbers between 0 and 12’’. <BR/><BR/>instead all you can do is assert ‘‘give me a class A object’’ which then accepts class B objects as well iff class B is derived from A. <BR/><BR/>add to that the restrictions of single inheritance (evil) and the braindead distinction between ‘‘integers as such and integers as objects’’ (evil evil) and you know why java code can be so endlessly tedious to conceive and write. <BR/><BR/>it is imho not so much static typing per se, it is java’s lack of expressivity when stating parameter constraints coupled with java’s oop implementation that makes things so hard. <BR/><BR/>python, on the other hand, has too few built-in type assertions, but it does allow you to do useful things. for example, to build one text from all the thingies in an iterable, you can can say eg ','.join( value for value in values ). this will fail if on of the values is not already a text, so you need an iterable of texts, which you can not succinctly express in that language. BUT it does work for general iterators of texts, for dictionaries with textual keys, for lists of strings, for tuples of strings and so on. to make up for the shortcoming, you’d have to write some type checking of your own, and that will never be as strict or reliable as in java (something that i can live with).Anonymousnoreply@blogger.com