gemot encubed  

Go Back   gemot encubed > Gemot > Technical Issues

Technical Issues For bug reports, problem solving, and help running Japanese software.

Reply
 
Thread Tools Display Modes
  #1  
Old 2006-11-30, 16:12
Rasqual Twilight
Guest
 
Posts: n/a
Default ML? You said ML?

While having a sneak peak at The Boss' Subversion repository, I noticed a few programs written in an ML language, not sure which.

Having had a bit of bitter taste of OCaml, I wondered how you ended up learning this programming language. Sure, it's concise and all, but barely makes more sense than hieroglyphs to me :)
Reply With Quote
  #2  
Old 2006-11-30, 23:08
zalas zalas is offline
 
 
Join Date: Feb 2004
Location: fushigi misuterii
Posts: 1,831
Send a message via ICQ to zalas
Default

I think you would really just have to rethink how you program things for ML to make sense, as it's a functional programming language as opposed to an imperative programming language. I believe Haeleth's using OCaML...
__________________
~Yoda is waiting in the air~ | HAVEN
Reply With Quote
  #3  
Old 2006-12-01, 11:03
Roto
Guest
 
Posts: n/a
Default

It takes some time to get used to functional programming, and you have to approach it differently than an imperative language.

One advantage to many functional languages is the ability to run the interpreter interactively, which can be really useful when you're trying to reverse engineer a file format since you can try things without having to figure everything out beforehand and compile before you can do anything useful.
Reply With Quote
  #4  
Old 2006-12-01, 11:26
Haeleth's Avatar
Haeleth Haeleth is offline
Ex-boss
 
Join Date: Mar 2003
Location: England
Posts: 2,106
Default

Yup, it's OCaml. Why do I use it? Because I find it a nice compromise between fast-but-clunky languages like C++ and expressive-but-slow languages like Python and Ruby.

This explains why I chose OCaml for RLdev better than I ever could. ^^

And to answer the specific question of how I came to learn it... well, I was kind of bored one day... :P
Reply With Quote
  #5  
Old 2006-12-01, 20:42
zalas zalas is offline
 
 
Join Date: Feb 2004
Location: fushigi misuterii
Posts: 1,831
Send a message via ICQ to zalas
Default

I actually prefer Python for prototyping, as speed usually isn't an issue when you're poking around, and the resulting code is at least somewhat legible by most people who know programming languages ^_^;

But yeah, OCaml has a clear advantage in being able to be compiled and is clean about it. To speed up Python programs, you'd need either a just-in-time compiler like psyco, or you need to write your fast functions in another language and load it in as a DLL with ctypes. (Well, there's also writing a real Python module in C or something, for you masochists out there...)
__________________
~Yoda is waiting in the air~ | HAVEN
Reply With Quote
  #6  
Old 2006-12-02, 06:33
Rasqual Twilight
Guest
 
Posts: n/a
Default

What's been keeping me away from Python thus far is the clunky TAB enforcement actually, otherwise the immediate evaluation of statements is nice indeed. My preference in the gang of the P's language would rather be PHP, despite its shortcomings, then Perl due to its Huge collection of libraries (but that's also a hard-to-decipher language).

Otherwise Ruby seems to be a practical language, but lacks a bit of reference paper books...
Reply With Quote
  #7  
Old 2006-12-02, 07:39
PyTom's Avatar
PyTom PyTom is offline
Regular
 
Join Date: Nov 2005
Posts: 91
Default

I should point out that there is quite a bit of work being done on compiling python. It's still experimental, but in a few years it will probably be something used more often. (See the PyPy project, which intends to rewrite the python runtime in python, and then convert it to native code.)

Indentation enforcement is one of those things that looks like it will be a big issue at the start, but really isn't one when a text editor supporting it is used. Also, people don't usually realize the exceptions for strings and parenthesized expressions.
Reply With Quote
  #8  
Old 2006-12-02, 10:18
Haeleth's Avatar
Haeleth Haeleth is offline
Ex-boss
 
Join Date: Mar 2003
Location: England
Posts: 2,106
Default

My reason for avoiding Python is actually as much to do with the way it handles types as with speed.

This is very much a matter of personal taste, and one in which I seem to be in a minority, but I find untyped languages very hard to read - unless the programmer has been very rigorous with comments (which is unlikely if he was prototyping!), I find myself constantly having to hunt around through pages and pages of code just to try to work out what fields a given object is supposed to have, or trying to find out where a given variable was actually initialised, and so on.

Things that in OCaml, I can just ask the compiler to tell me... ;)

Last edited by Haeleth; 2006-12-02 at 11:40.
Reply With Quote
  #9  
Old 2006-12-02, 13:28
zalas zalas is offline
 
 
Join Date: Feb 2004
Location: fushigi misuterii
Posts: 1,831
Send a message via ICQ to zalas
Default

Quote:
Originally Posted by Haeleth View Post
My reason for avoiding Python is actually as much to do with the way it handles types as with speed.

This is very much a matter of personal taste, and one in which I seem to be in a minority, but I find untyped languages very hard to read - unless the programmer has been very rigorous with comments (which is unlikely if he was prototyping!), I find myself constantly having to hunt around through pages and pages of code just to try to work out what fields a given object is supposed to have, or trying to find out where a given variable was actually initialised, and so on.

Things that in OCaml, I can just ask the compiler to tell me... ;)
I actually am very careful with comments, because if I don't comment something that's not obvious, I'll forget exactly wtf I was doing. ^^;
__________________
~Yoda is waiting in the air~ | HAVEN
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
One people said Unregistered General Discussion 3 2006-12-13 12:22


All times are GMT -8. The time now is 23:38.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.