Loading ...
Sorry, an error occurred while loading the content.
 

RE: [hackers-il] [colloq@cs.Technion.AC.IL: Shimon Schocken on Tu esday 05/06/2001]

Expand Messages
  • Chen Shapira
    ... IMO if the homework grade isn t part of the final grade, there s nothing immoral with copying work, its just abit stupid. ... Same in TAU. But most of us
    Message 1 of 11 , Apr 10, 2001
      > I don't know the official rules, but my inner morals tells me
      > that it is
      > perfectly fine to publish homework *you* did, assuming that
      > your solution
      > is a much more substantial work than the question itself.
      > What is NOT fine
      > is to look at such solutions instead of trying to do the work
      > yourself.

      IMO if the homework grade isn't part of the final grade, there's nothing
      immoral with copying work, its just abit stupid.

      > In my opinion the same should be true also for tests: you
      > should be allowed
      > to publish previous tests and suggested solutions. As far as
      > I saw, this was
      > the norm in the Technion (the student union even gave people
      > small gifts
      > if you gave them copies of tests) but strangely it seems to
      > be frowned upon
      > in HaifaU...

      Same in TAU. But most of us learned that those solutions aren't too
      reliable.

      > It is obvious why professors would not want previous
      > excercises and tests
      > to be published - it will force them to make up new questions
      > every once
      > in a while. But every now and then these professors need to
      > be reminded that
      > they are paid for this work, and that the raison d'etre of BA
      > studies is
      > to teach the students well, not to make life easy for the professor...

      Over here most assistants publish previous tests and excersizes in their web
      page.
      But I suspect that those assistants enjoy making the professors work.

      > > a rant on pascal: how can a language have none of
      > > case sensitivity
      > > initialization of const arrays
      > > no return from functions or procedures (!)

      I didn't do pascal for a long time, but:

      1) I don't think there is any inherit advantage to case sensitivity over
      case insensitivity in programming languages. Its more of a matter of taste
      and common practices.
      What is very important is the proper use of case in variable names, but this
      has nothing to do with the language.

      2) What do you mean by "no return from functions"? IIRC you call a function
      and get a returned value, no?

      The worse part about Pascal IMO is that there's no pointer to functions, and
      no annonymous functions. On the other hand it has nested functions (I
      think), which I wouldn't mind seeing in more langauges.
    • Chen Shapira
      ... Lets take note that this intermediate language is very much similar to lisp. Which may be attributed to some GNU bias, or the wide knowledge about
      Message 2 of 11 , Apr 10, 2001
        > also, perhaphs
        > translating to c is much harder than translating to an intermediate
        > internal representatio, which is the way gcc front ends work.

        Lets take note that this intermediate language is very much similar to lisp.
        Which may be attributed to some GNU bias, or the wide knowledge about
        compilation and lisp-like languages.
      • mulix
        ... sure there is, when you are debugging with a textual debugger, such as gdb. why, oh why, if i declare a variable as foo_bar, should i do print FOO_BAR ? i
        Message 3 of 11 , Apr 10, 2001
          On Tue, 10 Apr 2001, Chen Shapira wrote:

          > > > a rant on pascal: how can a language have none of
          > > > case sensitivity
          > > > initialization of const arrays
          > > > no return from functions or procedures (!)
          >
          > I didn't do pascal for a long time, but:
          >
          > 1) I don't think there is any inherit advantage to case sensitivity over
          > case insensitivity in programming languages. Its more of a matter of taste
          > and common practices.
          > What is very important is the proper use of case in variable names, but this
          > has nothing to do with the language.

          sure there is, when you are debugging with a textual debugger, such as
          gdb. why, oh why, if i declare a variable as foo_bar, should i do 'print
          FOO_BAR'? i suspect at some point the debugging symbols are converted to
          upper case by the compiler.

          > 2) What do you mean by "no return from functions"? IIRC you call a function
          > and get a returned value, no?

          of course, of course. i was referring to a return in the middle of a
          function, once you discover an error condition or a predicate cannot be
          fulfilled. also, since the code i wrote used a back tracking (recursive)
          algorithm, being able to return in the middle of a function was crucial.

          > The worse part about Pascal IMO is that there's no pointer to functions, and
          > no annonymous functions. On the other hand it has nested functions (I
          > think), which I wouldn't mind seeing in more langauges.

          pointers to functions you don't have, but i seem to recall you can pass
          the functions themselves as parameters, just cannot return them?

          --
          mulix
          http://www.advogato.com/person/mulix

          linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
        • Chen Shapira
          ... My apologies. I had in mind case-insensitivity VB style. You write print foobar and your friendly debugger will match FOOBAR, FooBAr, etc. I understood
          Message 4 of 11 , Apr 10, 2001
            > sure there is, when you are debugging with a textual debugger, such as
            > gdb. why, oh why, if i declare a variable as foo_bar, should
            > i do 'print
            > FOO_BAR'? i suspect at some point the debugging symbols are
            > converted to
            > upper case by the compiler.

            My apologies.
            I had in mind case-insensitivity VB style.
            You write "print foobar" and your friendly debugger will match FOOBAR,
            FooBAr, etc.

            I understood case insensitive in the sense of "case doesn't matter to us at
            all". I'm sure you know SQL works this way.
            I had no idea Pascal thinks case-insensitive means everything is uppercase.

            *That* is horrible.


            > > The worse part about Pascal IMO is that there's no pointer
            > to functions, and
            > > no annonymous functions. On the other hand it has nested
            > functions (I
            > > think), which I wouldn't mind seeing in more langauges.
            >
            > pointers to functions you don't have, but i seem to recall
            > you can pass
            > the functions themselves as parameters, just cannot return them?

            Interesting. I would try it if I'll find myself with a pascal compiler in a
            small room with nothing better to do :-)
          • Moshe Zadka
            ... No it isn t. It s about as similar to Lisp as C is similar to Java. -- I ll be ex-DPL soon anyway so I m |LUKE: Is Perl better than Python? looking
            Message 5 of 11 , Apr 10, 2001
              On Tue, 10 Apr 2001 13:09:49 +0200, Chen Shapira <chen@...> wrote:

              > Lets take note that this intermediate language is very much similar to lisp.

              No it isn't.
              It's about as similar to Lisp as C is similar to Java.
              --
              "I'll be ex-DPL soon anyway so I'm |LUKE: Is Perl better than Python?
              looking for someplace else to grab power."|YODA: No...no... no. Quicker,
              -- Wichert Akkerman (on debian-private)| easier, more seductive.
              For public key, finger moshez@... |http://www.{python,debian,gnu}.org
            • Oleg Goldshmidt
              ... Come on, you are a lisp-er. Or should it be LISP-er ? I strongly suspect it s a particular implementation. I think f2c also has something like this. While
              Message 6 of 11 , Apr 10, 2001
                Chen Shapira <chen@...> writes:

                > I had no idea Pascal thinks case-insensitive means everything is uppercase.
                >
                > *That* is horrible.

                Come on, you are a lisp-er. Or should it be "LISP-er"?

                I strongly suspect it's a particular implementation. I think f2c also
                has something like this. While Fortran itself is truly
                case-insensitive (it has another horrible feature - its identifiers
                are white-space-insensitive as well), having a foo or a FOO in the
                code will lead you to a foo in the debugger. In f2c actually. I don't
                find it particularly horrible (it's all lower-case), nor did I object
                too much to name-mangling, which was an evil, but a necessary one.


                --
                Oleg Goldshmidt | ogoldshmidt@...
                "I'd rather write programs to write programs than write programs."
              • Chen Shapira
                ... I have no idea what you mean by this analogy. But since this is a nice game, why don t we continue? I think RTL is like lisp as a cell-phone is like those
                Message 7 of 11 , Apr 10, 2001
                  > No it isn't.
                  > It's about as similar to Lisp as C is similar to Java.

                  I have no idea what you mean by this analogy.

                  But since this is a nice game, why don't we continue? I think RTL is like
                  lisp as a cell-phone is like those army motorolla's.

                  Wasn't it part of those tests some people take to join the university? find
                  the correct analogy?

                  But since I believe this is useless, let me explain exectly what I ment, by
                  quoting the manual:

                  -----
                  RTL is inspired by Lisp lists. It has both an internal form, made up of
                  structures that point at other structures, and a textual form that is used
                  in the machine description and in printed debugging dumps. The textual form
                  uses nested parentheses to indicate the pointers in the internal form.
                  -----

                  I would also say that this is a low level lisp.

                  But again, we are discussing descriptions now, which isn't too productive.

                  You now know what I mean. I consider this enough to call "similar". If you
                  think it isn't similar. Or you think that the right description is "as
                  similar to lisp as java is to c", feel free to enjoy yourself.
                • Nadav Har'El
                  ... Several people repeated this fact , that Pascal doesn t have a statement to return in the middle of the function. Are you sure??? I haven t programmed
                  Message 8 of 11 , Apr 10, 2001
                    On Tue, Apr 10, 2001, mulix wrote about "RE: [hackers-il] [colloq@...: Shimon Schocken on Tu esday 05/06/2001]":
                    > > 2) What do you mean by "no return from functions"? IIRC you call a function
                    > > and get a returned value, no?
                    >
                    > of course, of course. i was referring to a return in the middle of a
                    > function, once you discover an error condition or a predicate cannot be
                    > fulfilled. also, since the code i wrote used a back tracking (recursive)
                    > algorithm, being able to return in the middle of a function was crucial.

                    Several people repeated this "fact", that Pascal doesn't have a statement
                    to return in the middle of the function. Are you sure??? I haven't programmed
                    Pascal for quite a few years, but I seem to remember it had a "return"
                    statement. In fact, I remember arguing with the Metargel in the course
                    "Mavo Lemachshev Pascal" who deducted points for using "return" - eventually
                    I got him to admit (if I remember correctly) that there is such a statement
                    but it is considered "muktze michamat mius", like C's "goto".

                    Perhaps the Wirth's original Pascal didn't have a return statement, and
                    only later extensions added it? I don't know...

                    --
                    Nadav Har'El | Tuesday, Apr 10 2001, 17 Nisan 5761
                    nyh@... |-----------------------------------------
                    Phone: +972-53-245868, ICQ 13349191 |I couldn't think of an insteresting
                    http://nadav.harel.org.il |signature to put here... Maybe next time.
                  • mulix
                    ... empirically sure. when writing the excersize, we searched in all of the pascal books we found, and none of them made any mention of this. perhaphs it is a
                    Message 9 of 11 , Apr 10, 2001
                      On Tue, 10 Apr 2001, Nadav Har'El wrote:
                      > On Tue, Apr 10, 2001, mulix wrote about "RE: [hackers-il] [colloq@...: Shimon Schocken on Tu esday 05/06/2001]":
                      > > > 2) What do you mean by "no return from functions"? IIRC you call a function
                      > > > and get a returned value, no?
                      > >
                      > > of course, of course. i was referring to a return in the middle of a
                      > > function, once you discover an error condition or a predicate cannot be
                      > > fulfilled. also, since the code i wrote used a back tracking (recursive)
                      > > algorithm, being able to return in the middle of a function was crucial.
                      >
                      > Several people repeated this "fact", that Pascal doesn't have a statement
                      > to return in the middle of the function. Are you sure??? I haven't programmed

                      empirically sure. when writing the excersize, we searched in all of the
                      pascal books we found, and none of them made any mention of this. perhaphs
                      it is a frowned upon idiom?

                      > Pascal for quite a few years, but I seem to remember it had a "return"
                      > statement. In fact, I remember arguing with the Metargel in the course
                      > "Mavo Lemachshev Pascal" who deducted points for using "return" - eventually
                      > I got him to admit (if I remember correctly) that there is such a statement
                      > but it is considered "muktze michamat mius", like C's "goto".

                      c's goto is a painful subject for me. i happen to think that using c's
                      goto in controlled circumstances, like omer described in another post and
                      can be seen copiously in kernel sources, is a pretty neat technique.
                      unfortunately, i have refrained from using it in all technion assignments,
                      to spare myself from arguing with TAs. of course this only means i get
                      deducted points for other unorthodox coding methods which the TAs are not
                      familiar with, but i've never shied away from a good argument :)

                      case in point, in one excersize in matam i used a) extern to support a
                      single global log object in a c project and b) implemented myself a matrix
                      object we were given an object file for (which i considered buggy). this
                      lead to the ta's automatic compilation tests breaking on my code in new
                      and spectacular ways. i got 50 on the exercise, and after 30 minutes of
                      explaining to the teacher's assistants why what i did was both legal and a
                      good idea, got my grade boosted to 110 (there was a trivial bonus).

                      > Perhaps the Wirth's original Pascal didn't have a return statement, and
                      > only later extensions added it? I don't know...

                      i'm curious if anyone is using pascal in the "real world". i do know of
                      a few places using "object pascal" (borland's delphi).
                      --
                      mulix
                      http://www.advogato.com/person/mulix

                      linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
                    • Omer Musaev
                      ... I had heard of someone who was used Pascal as intermediate code for complex distributed control system. The system was scriptable in very syntax-sugared
                      Message 10 of 11 , Apr 10, 2001
                        > -----Original Message-----
                        > From: mulix [mailto:mulix@...]
                        ...
                        > I'm curious if anyone is using Pascal in the "real world". I
                        > do know of
                        > a few places using "object Pascal" (Borland's Delphi).

                        I had heard of someone who was used Pascal as intermediate code
                        for complex distributed control system.

                        The system was scriptable in very syntax-sugared language, which was
                        translated to Pascal, compiled and passed to backend as object code.

                        I learned that the approach was a success.

                        > --
                        > mulix
                        > http://www.advogato.com/person/mulix
                        >
                        > linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
                      • Nadav Har'El
                        ... Hmmm... I looked again at an old Pascal program I had, and it was an exit statement that returned from a function (not called return as I thought). And
                        Message 11 of 11 , Apr 10, 2001
                          On Tue, Apr 10, 2001, mulix wrote about "Re: [hackers-il] [colloq@...: Shimon Schocken on Tu esday 05/06/2001]":
                          > > Several people repeated this "fact", that Pascal doesn't have a statement
                          > > to return in the middle of the function. Are you sure??? I haven't programmed
                          >
                          > empirically sure. when writing the excersize, we searched in all of the
                          > pascal books we found, and none of them made any mention of this. perhaphs
                          > it is a frowned upon idiom?

                          Hmmm... I looked again at an old Pascal program I had, and it was an "exit"
                          statement that returned from a function (not called "return" as I thought).
                          And some website digging I found the following in the Gnu Pascal manual
                          http://didaktik.physik.uni-essen.de/~gnu-pascal/gpc_286.html#SEC286

                          "'Exit' leaves the currently executed procedure or function.
                          `Exit' is a UCSD Pascal extension. GNU Pascal does not support all
                          uses of `Exit' but only those defined in Borland Pascal."

                          So I guess "exit" appeared in UCSD Pascal, and then copied to Borland's
                          "Turbo Pascal" (at least from version 4, which was the first version I
                          used). I bet it exists in any modern Pascal implementation...
                          Actually, UCSD pascal dates back to 1978, which predates the ISO standard
                          (1983) or Borland's Turbo Pascal, or even Kernighan's paper. I don't see
                          how the metargelim, or even Kernighan can claim that Pascal doesn't have
                          an "exit" statement - Wirth's original Pascal from 1970 is just as irrelevant
                          as the Fortran original 1956 standard... I haven't read the 1983 standard
                          though - perhaps they decided not to except the "exit" extension, even
                          though all implementations had it?

                          BTW, Turbo Pascal also had (if I remember correctly) a "break" statement
                          to exit loops that Kernighan writes that Pascal doesn't have... I guess that
                          modern pascal compilers fixed some of the things that bothered him :)

                          --
                          Nadav Har'El | Tuesday, Apr 10 2001, 17 Nisan 5761
                          nyh@... |-----------------------------------------
                          Phone: +972-53-245868, ICQ 13349191 |How long a minute depends on what side
                          http://nadav.harel.org.il |of the bathroom door you're on.
                        Your message has been successfully submitted and would be delivered to recipients shortly.