Re: Java or C++?



CTips wrote:
>> That's about 300LOC in ML and is a (tiny) first step towards writing a
>> compiler for a FPL.
>
> OK. I suspect that you're talking about basic type inference not the
> Alex Aiken et.al. "enhancements".

I've never heard of Aiken. Do you mean this specifically:

http://citeseer.ist.psu.edu/aiken93type.html

The derived works by Damas and Mycroft are more famous. I had a look at the
former but not the latter. There are many other extentions as well, e.g.
the rest of OCaml's type system.

>> What if you have better things to do with your time than implement all
>> memory management by hand?
>
> I haven't noticed it cutting down on my productivity at all. Of course,
> for the stuff we do, its the algorithms do tend to be complex, so I
> assume for someone who does simple algorithms and/or small programs the
> memory management might dominate [though I find it hard to believe]

I found it prohibitively tedious to factor code without fundamental
constructs like closures, and prohibitively error-prone without static type
checking.

>> Again, I don't contest that C is great for trivial programs where you can
>> actually list the "intervening steps". For anything intrinsically
>> complicated, C is hopelessly ineffectual.
>
> Lets see: compilers - C. OSes - C. Real-time programs - C. EDA tools -
> C. Network routers - C. Care to name something that is intrinsically
> more complicated than those programs? (Well, I can think of a few that
> might be - a bunch of numerical programs, some medical imaging stuff,
> FEM packages, ATC, SABRE - but I suspect several of those are done in C
> as well)

If you mean there are some such projects written in C then yes, sure,
especially old ones. However, the cores of OS's are probably best written
in C. Hard real-time programs maybe, not soft real-time though (e.g.
visualisation). EDA tools, no. Network routers, no.

As for more complicated stuff, there's lots of more complicated stuff like
compiler writing, theorem proving, CAS, scientific computing,
visualisation, concurrent programs, IDEs...

>> Have a play with some more modern languages like OCaml and Haskell.
>
> I don't know - what does OCaml have that, say, LISP with CLOS does not?

Brevity.
Better performance.
More expressive type system.
Static type checking.
Easier functional programming (HOFs, currying etc.)
....

> Or (apart from the object stuff) that ML does not?

Better pattern matching.
Easier-to-use parsers.
Macros.
....

> Basically - I have all the power I need in C. I've seen what can be done
> in other langauges. It can pretty much all be recreated inside C.

It can "pretty much" be recreated in any Turing complete language, so that
isn't a valid argument in favour of C.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: Cargo Cult Membership
    ... if I were writing a compiler I suspect I'd prefer that, ... to simplify special casing on different architectures... ...
    (talk.origins)
  • Re: How do you interpret this code ?: Modified := Original + 1;
    ... isp's newsserver which is kinda weird. ... Which makes me wonder about maybe writing a p2p usenet system without ... Yesterday I thought the compiler generated it differently, ... The Original is loaded into EAX, ...
    (alt.comp.lang.borland-delphi)
  • Re: CC65 and REAL WORLD question
    ... I know the guys that work on the CC65 compiler know how to use it. ... Writing a web server for an old computer also seems pointless to me. ... I actually had a pretty cool sideline writing these kiddie games at one ...
    (comp.sys.apple2.programmer)
  • linuxassembly (italian book) I will not allow more than follow the work.
    ... programming in assembly x86-32/64 on Linux. ... I started after writing a small tutorial on writing a compiler step by ...
    (comp.lang.asm.x86)
  • Re: Parser or regex ?
    ... than using standard-library tools that are designed for parsing Python. ... >>> from compiler import ast ... The compiler.visitor package may also be of help in writing tree-walker ... Note that with a bit of black magic, you can modify the AST, and then ...
    (comp.lang.python)