Hacker Newsnew | past | comments | ask | show | jobs | submit | username3720's commentslogin

I'd strongly advise people to read K&R C as maybe their second or third book and mostly for historical purposes and not because it's particularly great for learning the language. The exercises are quite fun, however.

You will be better served by reading a more recent (C99) and carefully considered book such as K.N. King's C Programming: A Modern Approach.


A fun paper, but it neglected to explain its means of modularization. I had to read the language implementation to discover the 'require' keyword used to import functions.

Projects like Mercury (http://mercurylang.org/) are also covering similar space.


Michael Hendrix described Mercury as Haskell + Prolog, which is accurate, I think, and an indication that Mercury is pretty far removed from what Cosmos is trying to do. (I'm more interested in Mercury). Cosmos looks like it wants to be a multi-paradigm scripting language, whereas Mercury is aiming for logical purity (no cuts), strong and static typing, and high speed (...for a Prolog). I think Picat (http://www.picat-lang.org/) or Ciao (http://ciao-lang.org/) are probably closer matches to Cosmos.


Sucks, cannot edit old comment. Correction:

Michael Hendrick: https://www.youtube.com/watch?v=G_eYTctGZw8


The Oberon/Modula-2 family happens to be among my favorite languages. It's one of the easier languages to implement and Amazon happens to have cheap Modula-2 compiler books. Wirth's own Compiler Construction book is free, though it's the definition of terse. I rather liked Julian R. Ullmann's Compiling in Modula-2 and John Elder's Compiler Construction.

There's still interesting work that is out there to rediscover involving the family. Luca Cardelli wrote a rather good paper on typechecking in Modula-2[1]. More recently there's projects like Modula-2 R10[2] in the works, which could prove to be a rather fun language to work with.

I thought University of Cambridge's track for teaching Standard ML to C via Modula-3[3] was a fantastic idea. (I also have a lot of love for SML.) By learning types and modules via SML or Modula first, it will ease understanding more advanced C concepts. C's weaker typing and implicit conversions make the value of types less clear and easier to ignore. I feel that C's headers and abstract data type construction are clunkier than they have to be and also devalue the idea of modules.

I would love to see renewed interest in Modula-2 in particular. The death of the commercial compiler industry has neglected it. It eschews garbage collection and I think it resembles a fixed C. For roughly ten years General Motors used it for embedded work.

Another excellent resource: http://oberon07.com/

[1]: http://lucacardelli.name/Papers/BasicTypechecking.pdf [2]: https://bitbucket.org/trijezdci/m2r10/src [3]: http://www.cl.cam.ac.uk/~pr10/publications/plc93.pdf


When I learned C back in 1992, it felt primitive and clunky when compared to Turbo Pascal 6 (I used 3.0 and 5.5 before).

Unsafe and lacking all the OO and modular features from Turbo Pascal. I kept on using Turbo Pascal up to Turbo Pascal 1.5 for Windows and a little bit of of Delphi afterwards.

Wirth had me, systems programming with safe languages, I also got to learn about Modula-3 and was able to get hold of Native Oberon for PC.

My relationship with C was quickly replaced by C++, which allowed me to regain some of Pascal's type safety in a world that disdained Niklaus Wirth work and now is looking how to replace the security exploits C semantics brought upon us.

At least modern C++ eschews C programming practices.


For those looking for Wirth's book mentioned by the parent: http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf


What are your thoughts on the link between go and oberon? Go is an aweful lot like oberon, but with curly braces and a lot of syntactic sugar imo. I've never read anything about pike citing oberon, but the influence on plan 9 is clear, imo.


I think Lua is more related to the Oberon family than Go is. Lua's control constructs are reminiscent of Modula-2. What Lua has done with tables and modules is pretty elegant and I can see more of the highlights of the Oberon family in Lua than I do Go.

The few Oberon-like aspects I see in Go beyond the obvious ':=' operator are things like the 'range' keyword and methods. Both Oberon and Standard ML encourage composition a bit differently when it comes to functions and modules. You're lead to using more locally-defined functions in the context of writing a function. Modules are more at the forefront, with less hesitancy to define simple ones. Go I think more resembles an attempt to make a scripting language out of Plan 9's C and threading with a few odd-and-ends. I do very much like that it avoided objects.

However, I think even Modula-3 which appeared by the end of the late 80s already had things that Go right now is lacking. That said, I've used Go for some production projects. Some projects fit neatly into Go's standard library, which is the star of the language along with its ideas on tooling. The language itself I could take or leave.


> I think even Modula-3 which appeared by the end of the late 80s already had things that Go right now is lacking.

- Type safe enumerations

- Generics

- Exceptions

- Reference parameters

- Range types

- (real) Systems programming support

- An OS implemented in it (Spin) with support for POSIX APIs


Yes, Rob Pike mentioned Oberon here: http://talks.golang.org/2014/hellogophers.slide#21 and it's also mentioned in Go FAQ http://golang.org/doc/faq#ancestors


Go's method declaration syntax is based on Oberon-2.

And also how the packages work, is loosely based on how Oberon modules work.

Finally, unsafe has some resemblance with SYSTEM module.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: