Re: 38 year old seeks new use for computer



We are thankful to Jon Harrop for sharing the following with us:

Matt wrote:
I love the OpenGL ones and the
fractal ones. So what would I need to learn in order to do this?

So you like maths and graphics, use Linux and want to do OpenGL. I'd say
OCaml should be ideal. It has a solid mathematical foundation, runs
natively under Linux and gives you access to the core of OpenGL.

I hadn't heard of this language.
Looking at your code examples, the language seems quite readable.
Ocaml seems to be able to get a lot done with relatively little code.

Check out the visualisation examples from my OCaml book:

http://www.ffconsultancy.com/products/ocaml_for_scientists/visualisation

The demos are nice.
Unfortunately I get a 404 when trying to look at the code.

There's also an aesthetic ray tracer that renders using OpenGL:

http://www.ffconsultancy.com/free/ray_tracer

and a cut-down version that is mathematically elegant:

http://www.ffconsultancy.com/free/ray_tracer/languages.html

You mentioned fractals, well here's a minimal Mandelbrot renderer (using
OpenGL):

http://www.ffconsultancy.com/free/fractal

I think you'll probably also appreciate a 19-line Sudoku solver:

http://www.ffconsultancy.com/free/sudoku

If you can find a Windows box with .NET 2 on it then have a play with the
165-line F# version of that Sudoku solver that has a GUI:

http://www.ffconsultancy.com/dotnet/fsharp/sudoku

If you're running Debian then you'll need to install OCaml and the OpenGL
bindings with something like:

apt-get install ocaml liblablgl-ocaml-dev

I'm guessing that C is probably behind it all.

If you look hard enough then you'll find C pretty much everywhere but
programming in C is very boring and repetitive. With a modern language
you'll be able to do much more sophisticated things with no trouble at
all.

I'm sure I could pick up some programming concepts from just about any
language, but as I'd like to end up doing screensaver/graphics stuff
should I just learn the language that I'll use rather than a 'training
language' (for want of a better expression)?

You can do graphics from most languages these days so I suggest you have a
look at each language's capabilities and background and pick the one that
most interests you.

I think I am coming to appreciate how languages have evolved and how some
are better suited for certain tasks.
There's no need to use a sledgehammer to crack a nut any more.
I'll work through some Ocaml tutorials and play around a bit. It does look
very interesting.

Also, for those with experience, do you think my goal is realistic and,
for someone my age with essentially no knowledge, achievable?

Absolutely!

Thanks for the advice.
And thanks for the vote of confidence :).

.



Relevant Pages

  • Re: Newbie Questions
    ... want to use a canned fractal program - I want to do it on my own. ... The math part of the fractals is no problem for me. ... My newbie question is what language should I write in? ... I've been told that OpenGL is best for graphics. ...
    (comp.programming)
  • Re: About alternatives to Matlab
    ... lifting scheme, while yours is a classic convolution based approach. ... I've done both in OCaml. ... Using a compiled language ... We are talking about this Python implementation, ...
    (comp.lang.python)
  • Re: Verbose functional languages?
    ... They are both working around deficiencies in the language using functors. ... Users of languages like SML and OCaml should not have ...
    (comp.lang.functional)
  • Re: About alternatives to Matlab
    ... 0.56s C++ (direct arrays) ... 0.62s OCaml ... optimized Python is roughly the same speed as naive Ocaml ... It would be relatively easy in a statically typed language. ...
    (comp.lang.python)
  • Re: Statically AND Dynamically Typed Language ??
    ... Linux compared to Windows. ... many other individuals are earning a living from their own language ... I have only limited knowledge about OCaml. ... if you compile a non-trivial program to native ...
    (comp.lang.misc)

Loading