Berkeley CSUA MOTD:Entry 30169
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

2004/5/11-12 [Computer/SW/Languages/OCAML, Computer/SW/Languages/Functional] UID:30169 Activity:very high
5/11    To FP activists on the motd, if currying is such a great idea, why
        it's not implemented symmetrically in say Caml?  It seems more
        natural to treat the arguments of a function more symmetrically.
        \_ If by 'symmetric' you mean that if, for example, I have a function
           f of two arguments a and b, I should be able to curry on either
           a or b, then Ocaml does this using labeled arguments.  Caml does
           not since it's meant to be a 'minimalist' language. -- ilyas
           not since it's meant to be a 'minimalist' language.  In conclusion,
           RIDE BULLET TRAIN!  USE OCAML!  -- ilyas
           \_ I am looking at it.  So far so disappointed.
              \_ I think most people who have been programming for a while
                 have gotten past the 'perfect language' disease.  I would be
                 happy to address specific questions you might have.  Or better
                 yet email me, or drop by #csua. -- ilyas
                 \_ I am not through with the reading yet, so I could be wrong.
                    So far, my complaint is the following: (1) rather bad
                    grammar in general.  (2) The use of capitalization and
                    special characters to signify different kinds of
                    identifiers at the language level.  (3) Field name in
                    record has file scope.  (4) If typing is such an important
                    aspect of it, it might as well make it optional to be
                    dynamic, same with patterns.  (5) Data structure does not
                    feel as flexible as it could be.  One might as well think
                    it is C and implemnt cons using record.  (6) I am not sure
                    how ref works, but I certainly miss pointers.  Overall,
                    it seems to be somewhere in the middle from C, Scheme, and
                    maybe Prolog.
                    \_ (1) People complain about the syntax.  It doesn't
                       bother me.  If it bothers you, Ocaml comes with a
                       syntax redefinition tool called camlp4 -- you can
                       change the ENTIRE syntax if you want.
                       \_ You can write preprocessors to make Fortran look
                          Lisp, Lisp look like Perl, Perl look like Basic,
                          Basic look like C, and C look like Fortran.
                       (2) This is because the language is 'rich.'  Perl does
                       the same thing.  I don't really know a better way.
                       What Ocaml has is better than throwing gobs of parens
                       at the problem like lisp does.  In other words, too
                       much syntax is better than too little.
                       \_ ruby i think is as powerful as perl yet has
                          a very clean syntax, without $ % and bare filehandles
                             it's as fast as it sounds. -- ilyas
                          etc.  -someone else
                          \_ It's true that ruby is clean, but this comes with
                             a price.  Everything in ruby is an object, and
                             it's as fast as it sounds.  The other thing about
                             ruby is that it's dynamically typed, so you need
                             to distinguish less things at compile time --
                             this translates into a lot less syntax.  Naturally,
                             dynamic typing makes things slow, also. -- ilyas
                             \_ No it doesn't. You are wrong on both accounts,
                                here. There are implementation techniques
                                to make pure object-oriented languages and
                                dynamically typed languages perform very
                                fast.
                                \_ Sure it does.  You may make it better than
                                   what ruby has (no hard accomplishment since
                                   ruby has possibly the slowest implementation
                                   of any language), but you will not be able to
                                   beat a statically typed language because
                                   the compiler simply has less information.
                                   OO is useful, but ruby makes everything an
                                   object, which is convenient but those virtual
                                   function calls do add up.  Anyways, if
                                   someone writes a fast ruby compiler, it will
                                   make me happy, ruby is a neat language.  A
                                   good thing to ponder, if you ever go to the
                                   'great language shootout' page, is why the
                                   fastest languages there are either C or
                                   statically typed.  -- ilyas
                                   \_ You are just wrong here. YMWTG
                                      polymorphic inline cache, or Cecil
                                      \_ Read what I said again.  I would be
                                         happy to look at some benchmarks of
                                         Cecil or Self.  Self is neat. -- ilyas
                                         \_ Stop being condecending. I wasn't
                                            referring to your complaints about
                                            the Ruby interpreter, but to
                                            your general statements about
                                            dynamically typed and pure OO
                                            languages. Virtual Machines
                                            have access to all the type
                                            information that was available
                                            statically, and in the case of
                                            some type systems, more. With
                                            that info, the VM and generate
                                            type-specific code, in-line away
                                            virtual functions, usw.
                       \_ I think it's more to shift the burdern from the
                          parser and compiler to the user.  Perl is not a
                          model for good design.
                       (3) Yes, I don't like that.  There are deeper problems
                       with structs and typing.
                         \_ I guess that labels of variant and records are
                            internally represented as integers.  I would be
                            nice to be able to access them directly.  Array
                            type should have the option of specify size,
                            both for efficiency and type checking.
                       (4) I don't understand your reasoning here.  Typing
                       in Ocaml makes me really happy because it catches bugs
                       for me, and because I know how to get around it if I
                       need to (Obj.magic).
                       \_ I am not saying typing is a bad idea.  But it would
                          be nice to have the option (1) to turn it off for
                          some variables or some types and (2) to delay some
                          typing until runtime and (3) go (not so much) further
                          make type a type that one can modifies and manipulate
                          in runtime.  The same goes for pattern.  There will
                          conceptual problems involved, but they are worth the
                          reward.  Plus, most of the logic underlying is
                          already present in the compiler and just need to
                          be incorporated in the runtime, if called for by
                          the program.
                       (5) Don't understand what you are trying to say.  Did
                       you notice the object system too, and functors?  Is the
                       stdlib bad?  What couldn't you find that you would find
                       in another stdlib?
                       \_ sorry, haven't got to the object system yet, but
                          generally I feel that a language should either
                          provide very elementary data structure that allows
                          one to describe arbitrary complex ones with relative
                          ease or provide so many high level data structures
                          that it is hard to ask more.  C and Lisp are
                          examples of the former, while custom programing
                          language (Maple, Mathematica, etc) falls with the
                          latter.  OCaml seems to be in the middle, which is
                          annoying.  For example, I haven't seen a set type,
                          which of course can be implemented with tuple.  But
                          it is not easy to implement efficiently, unless you
                          employs tricks that seem to defeat many OCaml
                          principles.  Again, I could be just ignorant of some
                          of the powers of ocaml.
                       (6) If you really want, you can play with pointers using
                       Obj.magic (again), but you probably don't need them.
                       Very few people these days need pointers (actual integer
                       values) over references (names referring to objects) in
                       practice.  -- ilyas
                       \_ somehow I couldn't find documentation for Obj.magic
                          but it sounds like something bad that if you use all
                          the time, you might as well use another language.
2024/11/23 [General] UID:1000 Activity:popular
11/23   

You may also be interested in these entries...
2008/7/28-8/5 [Computer/SW/Languages/Python, Computer/SW/Languages/Functional, Computer/SW/Languages/OCAML] UID:50704 Activity:nil
7/28    So, I'd like to try playing with a functional language.  Any
        recommendations?
        \_ Haskel.  Why would you start with anything else?
        \_ Haskell if you want a _functional_ language.  Ocaml if you want to
           see what a proper language implementation looks like.  LISP if
           you want old fogies to think you are cool. -- ilyas
	...
2005/7/15-18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:38653 Activity:moderate
7/15    Is it possible through JNI to write a function which takes a float[]
        array and through the magic of c casts it to an int array and then
        returns the int array to Java, not modifying the actual data?
        If not, is there a good Java way to do the C equivalent of:
        int* i = (int*) f; ?
        Don't ask whether I really need to be doing this because there is a
	...
2005/6/21-23 [Computer/SW/Languages/Perl] UID:38230 Activity:high
6/21    My math and/or perl fu is weak. Is there a way to get integer
        multiplication in Perl the way it's done in C? i.e. limiting
        to 32 bits. Like 1588635697 * 1117695901 = 1166976269 in C.
        \_ Can't you just multiply and then mask all but the last 32 bits?
           \_ I don't think so; that's not the same as mult overflow.
              > perl -e 'print (1588635697 * 1117695901)'
	...
2004/9/9-10 [Computer/SW/Languages/OCAML, Computer/SW/Languages/Perl] UID:33448 Activity:high
9/9     Why are there so much politics on the motd? Isn't this the
        CSUA? Doesn't the C stands for something computer??
        \_ Its stands for Computer Stuff and Unrelated Arguing
           \_ Golf clap.
              \_ I didn't know there even was such a thing as a golf ho,
                 and you're telling me they've got their own VD's?
	...
2004/7/1-2 [Computer/SW/Unix] UID:31106 Activity:insanely high
7/1     Using sed, how do I do the following?  I want to replace the
        first line containing a particular pattern with the 2nd line
        containing said pattern.  For example, if "line" is the pattern,
        then I want
                this is the 1st line
                this is the 2nd
	...
2004/6/25-26 [Computer/SW/Languages/Java] UID:31013 Activity:insanely high
6/25    What percent of security holes would be solved by banning strcpy()
        in favor of strncpy()?
        \_ probably not much, since they're all coming to be php bugs these
           days.
        \_ Or using Java instead of C (no buffer overrun)?
                \_ It is not always possible to use java. I have customers
	...
2004/5/21-22 [Computer/SW/Compilers] UID:30345 Activity:very high
5/21    I was not a CS major and never took the compiler class.  What is
        a good book to help me write a compiler?  And what about interpreter?
        Do they basically involve the same issues except code generation and
        optimization?
        \_ Use the book by Robert Mak, called "Writing Interpreters and
           Compilers in C++." It's a practical, hands-on "lab" type book which
	...
2004/5/20-21 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/OCAML] UID:30334 Activity:insanely high
5/20    I have seen some ocaml comments on the motd.  What about Haskell?
        Is it better/worse/about the same?  I know it is supposed to "pure"
        but don't know what this translates to in reality.
        \_ Haskell is the only language I want to know something about, yet
           know almost nothing about.  I know it's not speedy, unlike ocaml,
           but has lots of clean ideas, and you can write really short code in
	...
2004/4/30-5/1 [Computer/SW/Compilers, Computer/SW/Languages/C_Cplusplus] UID:13508 Activity:moderate
4/30    Quick C++ question. In Meyer's More Effective C++, Item 22, he has
        a snippet of code like this:
        template<class T>
        const T operator+(const T& lhs, const T& rhs)
        {
          return T(lhs) += rhs;
	...
2004/3/3-5 [Computer/SW/Languages/Functional] UID:12505 Activity:nil
3/3     I feel like messing with Scheme. I forgot all my CS61A. Do we have
        a scheme program here, and how do I run it?
        \_ type 'scm'
           \_ thanks.
        \_ if you want to dabble in common lisp, you can download an
           evaluation version at http://www.franz.com
	...
2009/4/24-28 [Computer/SW/Languages/Functional] UID:52902 Activity:nil
4/23    what book is this?
        "I'm reading this horrible horrible book about a programmer
         from silicon valley that gets magically
         transported into some world where magic is real
         and uses computer programming skillz to become the world's
         greatest sorceror … in book 1 of the series
	...
2008/12/17-2009/1/2 [Computer/SW/Languages/Functional] UID:52267 Activity:nil
12/17   wtf is happening to the dollar?
        http://quotes.ino.com/chart/?s=NYBOT_dx
        \_ People are finally taking Bernanke seriously when he says he
           is going to print as many dollars as he has to, to reinflate
           the dollar.
           is going to print as many dollars as he has to, to kill deflation.
	...
2008/4/2-6 [Computer/SW/Languages/C_Cplusplus] UID:49645 Activity:moderate
4/2     Is there an interpreted version of C or C++ that can be used for
        educational purposes? It doesn't have to be full-featured or
        strictly adhere to the standards, but it's painful for students
        to change a variable in a for loop and then wait for a compile
        to see how it changes the result. Something really lightweight
        would encourage them to play around a lot more and learn more in
	...
2008/3/13-17 [Computer/SW/WWW/Browsers] UID:49451 Activity:moderate
3/13    Firefox 3 Beta 4:  Fast, cleans up memory good on minimize, stable,
        can install alongside FireFox 2.x
        Cons:  Extensions don't work and need to install beta versions, rich
        urlbar is nasty but as of today you can install oldbar extension
        Ah-nold would say:  Fuckin' fan-tah-stik!
        \_ Does it use less memory than 2.x when not minimized?  Long ago Fx
	...
2007/9/20-22 [Computer/HW/Laptop, Computer/HW/Display] UID:48128 Activity:nil
9/20    For a HDTV >= 36", can someone quickly summarize the pros and cons
        of LCD vs Plasma please?  Thank you.
        \_ how much >= 36"?  From my research LCD seems the way to go until
           you get bigger than my wallet or apartment can handle.
           \_ I was looking at a 42".  Browsing through the store, I felt
              46" would've been too big for my apartment. -op
	...
2007/8/30-9/3 [Computer/Theory] UID:47837 Activity:nil
8/30    what AI is editing the motd?  that's some next level shit.
        \_ Sorry. -- ilyas
        \_ ilyas -> i l y a s -> s l y a i -> Sly AI
           \_ ilya shpitser -> lisp hysteria
	...