As i decided to focus purely on Haxe instead of Nim, my copy of Nim In Action book will be useless to me.
So when the physical book is printed and shipped to me in Europe ( 4 months until it ships ), i can forward it to somebody else. Only EU programmers because of shipping costs and stuff.
Anyway, its just a heads up for anybody interested.
What do you want for it?
Nothing at all. Think of it as a free gift. I'll ship it for free ( if your in the EU ). German is cheapest for me :)
Better to give it to another person then me just putting it on the bookshelf and not using it.
I would like to have it.
Ok. Send me a mail at nim_book@rhysoft.com with your name & address and when it arrives i will send it out to you.
@wulfklaue
Interesting; what's your movtivation to make the move from Nim to Haxe; would you mind giving details of your decision?
I just posted you the address, I am from Aachen so yes in Germany.
Got it. I will bookmark it in my mail folder, so i can send you the book later. If you change adres, do not forget to update. ;)
But it's said that you've decided for the wrong language
lol ... Each there own. ;)
Interesting; what's your movtivation to make the move from Nim to Haxe; would you mind giving details of your decision?
There are a few reasons, like disadvantage that i see:
Nim:
It matter because next year i plan on starting a development company and there needs to be a focus on one language that can do multiple avenues. Part of my thinking is simply that the more simple / faster the language is to get into, the more easy it is to hire developers.
Haxe:
C/C++/PHP:
In my case, from a C / PHP background, it just feels more natural. The developers i know are all much more familiar in such a background. Last week showing a colleague some quick sort Haxe code, he instantly understood the code and noticed the few differences in design. The same did not happen with similar Nim code.
Business:
This is not to dish Nim. Araq did a great job on Nim and made it into a impressive language. But i am looking at it from a business point of view. That is also why i was such a pain in Araq's behind about the Caps / Team standard issue :).
By having a language that can feel natural to a larger group of developers and yet is more future proof / targeting multiple platforms. And knowing that there is more development going on.
Because of my business design, the language i needed needs to be easy, fast but support multiple avenues ( web, gaming, system ) with the ability to switch away from one more easily. When you write a piece of code to benchmark and quickly compile it to 7 language platforms ( if you have the compilers installed ), you feel all giddy. :)
Haxe & Nim do share a lot of background but in all honesty ( do not take this too hard ), Nim still feels like a amateur / non-business focused project. Technically Nim is more advanced as a language but it comes at a cost of readability. The whole {} design feels too much tacked on the language to extend the functionality.
If i need to hire people and they need to learn the whole language / meta programming, it also cost money. Money that does not go into actually improving the products.
Anyway. Its less the features as the entire package that moved me to Haxe.
Points for improvement for Nim:
I wish Araq and the community all the best with Nim. :)
Little stab below the belt: Haxe you can search more easily in Google unlike Nim / Nimrod. gniffel :)
Got it. I will bookmark it in my mail folder, so i can send you the book later.
Why that effort? See google or Manning page:
https://account.manning.com/support
Section shipping:
I need to change my shipping address on a pending order.
Please send a message to support@manning.com and we can update your address for all pending orders.
Look like ECMAScript2015 (JavaScript, or TypeScript) very much ...
The more Java like expressions is probably because the original author Nicolas Cannasse wrote the MTASC ( Flash ) compiler. What used ActionScript and this in turn turned into ECMAScript. Describing it like JavaScript is almost like a insult lol. Got a profound dislike for JavaScript and can not say the same for Haxe.
To me its more like a extended PHP 7.1 design. Then again, PHP has slowly been merging towards a full C/Java style.
Why that effort? See google or Manning page:
Contact them a few days ago and they updated the shipping address. So Krux02 is going to ge the book directly.
Apart from the fact that it forces this object oriented programming paradigm that I alread learned to dislike from Java, it seems to be designed pretty ok.
Personally i do not understand why people still insist on functional programming. In general object oriented programming results in a more clean code base ( example ).
class FloatTools {
static public function round(f:Float) {
return Math.round(f * 100) / 100; // The value 100 rounds to two decimals
}
}
using FloatTools; // Adding 'FloatTools' as a static extension
class Main {
static function main() {
var f = 0.119999;
var rf = f.round(); // 0.12
var rf = 0.119999.round(); // 0.12
}
}
static function round(f) {
return Math.round(f * 100) / 100; // The value 100 rounds to two decimals
}
include "round.xxx";
var f = 0.119999;
var rf = round(f); // 0.12
var rf = round(0.119999); // 0.12
Both do the same in this simple example. But as one starts to extend functionality, its where you are much more likely to run into conflicts ( forcing the need for instance to namespace ). Of the two examples, what is more easy to extend ( inherit, override, abstract, etc ) and clean. Its simply the object oriented version. :)
The fact that it also forces the first initial call ( the Main construct ) to be a class, is less of a issue ( unless losing 4 lines of code, of the 1000's is a issue ;) ). If we simply look at GoLang with its forced function paradigm, it still relies on C like function attachment to objects.
I said it before but coming from a PHP background and with the PHP7 / 7.1 designs, its more easy to get into Haxe then Nim.
Nim really focuses more to Python developers. Where Crystal really focused on Ruby developers.
Nim & Haxe are languages that more incorporate from other languages. Crystal is almost a copy of Ruby ( but they recently start to incorporate other functionality from other languages ).
For me Haxe solves a few problems. Going to push it at work simply because: One can code base it for PHP but at the same time deal with the annoying JS and deal with Angular. Now at work its all separated and frankly messy ( but that is a different topic ;) ).
Almost forgot, another useful corner for Nim to look at: http://code.haxe.org/
In general object oriented programming results in a more clean code base ( example ).
Have you ever seen any codebase of a sufficiently large Java library/application? I have yet to see one example where OOP lead to a cleaner code base. This image is usually a pretty accurate description of an OOP codebase.
Personally i do not understand why people still insist on functional programming.
Nobody suggested functional programming.
Both do the same in this simple example.
And none is functional.
But as one starts to extend functionality, its where you are much more likely to run into conflicts ( forcing the need for instance to namespace ).
Namespaces have nothing to do with object orientation. You can perfectly use namespaces in non-OOP languages.
Of the two examples, what is more easy to extend ( inherit, override, abstract, etc ) and clean. Its simply the object oriented version.
So you show some OOP code, then you show some imperative, non-OOP code, and then you ask which is more easy to inherit, override, make abstract? Well, those are all things you do in OOP languages, and you just assume that this is useful and needed without providing any evidence for it. So tell me: How would you want to extend a round function, so that OOP becomes useful? The only useful extension is to be able to use it on other types than just float - and that can easily be done with generics and without OOP.
And um, calling this messy class Main { stuff clean is… nothing I would do.
If we simply look at GoLang with its forced function paradigm, it still relies on C like function attachment to objects.
Go is not functional, it is imperative. I also do not understand what exactly you mean by „C like function attachment to objects“. You seem to assume that it is necessary to attach functions to objects, without providing any evidence for it.
Nim really focuses more to Python developers. Where Crystal really focused on Ruby developers.
I do not think Nim focuses on Python developers at all. It shares some syntactic constructs with Python, but it is very different. Crystal, on the other hand, seems indeed to be very focused on Ruby devs.
Have you ever seen any codebase of a sufficiently large Java library/application?
Is this implying that sufficiently large codebase of any other (or of a specific programming language) would look any better? I don't think so, but i'd like to hear about that.
@wulfklaue
Personally i do not understand why people still insist on functional programming. In general object oriented programming results > in a more clean code base ( example ).
The irony of course is that the Haxe compiler itself is written in an impure functional programming language with an OO extension and there is little or no use of the OO part at all.
OK, not really so much a counterexample as a counterpoint, but still interesting.
Is this implying that sufficiently large codebase of any other (or of a specific programming language) would look any better? I don't think so, but i'd like to hear about that.
Almost all codebases of large applications look awful. There are a lot of reasons for that other than programming paradigms used. I do not want to claim that some would look better without OOP. I simply wanted to state that I had a look at a lot of code bases through the years in order to find evidence of how OOP would lead to cleaner code, and I have yet failed to find any.
@wulfklaue
Oh! ECMAScript2015, ECMAScript7 and Node.js are very popular now. I think you just not understand JavaScript. You should have a look at:
import fs from "fs";
const stateNone = 0;
const stateRead = 1;
const stateWrite = 2;
class IO {
constructor() {
this.state = stateNone;
}
async read(path) {
var io = this;
return new Promise(function (complete, fail) {
io.state = stateRead;
fs.readFile(path, function (err, data) {
if (err) {
fail(err);
} else {
io.state = stateNone;
complete(data);
}
})
})
}
async write(path, data) {
var io = this;
return new Promise(function (complete, fail) {
io.state = stateWrite;
fs.writeFile(path, data, function (err) {
if (err) {
fail(err);
} else {
io.state = stateNone;
complete();
}
})
})
}
}
(async function main() {
var io = new IO();
try {
var data = await io.read("/home/user/test1.txt");
await io.write("/home/user/test2.txt", data);
} catch (e) {
console.log("Error: ", e);
console.log("IO state: ", io.state);
}
} ())
Oh! ECMAScript2015, ECMAScript7 and Node.js are very popular now. I think you just not understand JavaScript.
Took me 10 second to read and understand your code. I just never liked JS design for front end programming. Too much overuse of closures, bad error responses, inconsistencies in the language. Like hey... lets check the array length. Its 0. Ok... Lets push something at position 5. Length is 6. Fine. Lets remove this. Wait ... why is the length still 6??? Same with the response as to the value it holds. Let alone when we start mixing JS with jQuery/Angular etc.
One need to differentiate between well defined and clean code, vs the smuk mess that well, i see most of the time in front of me. Guess where my dislike comes from ;)
Almost all codebases of large applications look awful. There are a lot of reasons for that other than programming paradigms used. I do not want to claim that some would look better without OOP. I simply wanted to state that I had a look at a lot of code bases through the years in order to find evidence of how OOP would lead to cleaner code, and I have yet failed to find any.
Maybe you have just been lucky.
This image is usually a pretty accurate description of an OOP codebase.
That is a mess more when people start mixing factor & dependency injection. Again ... OOP is not a badge of excellence but in general as a programmer they are already a step above most of the FP's.
Namespaces have nothing to do with object orientation. You can perfectly use namespaces in non-OOP languages.
I have yet to seen a single example of anybody using namespacing in functional programming. Then again, its relative "new" in PHP. rofl
you just assume that this is useful and needed without providing any evidence for it.
Yada yada yada ... typical forum bully tactics. Lets all wast hours fighting it out on a forum so one of use can both feel superior. There 1000 of topics regarding this, with plent of opinions. If you want to repeat history on each forum, go right ahead.
Wast of time again. Why do i even post on forums anymore. Its always the same crap. There is always somebody who gets pissed or disagrees and then wants to wast hours discussing something that will not change both parties there opinion anyway.
And none is functional.
Bullshit first class. If you can not tell the different between a piece of OOP & FP code, then you really do not need to start arguing about it. Feeling superior yet? Good, feel happy ... sigh
Yea, i am pissed. This is why i normally do not like to post on forums. Simply because people twist people there words to match there own definitions.
I simply wanted to point out that function programming in "general", like i said in my experience, come from people who have a lack of understanding OO programming. This simply results in horrible code messes.
I have a dozen of websites right in front of me, made in East Europe with functional programming. And there are amateuristisch at best. We spend more time trying to rewrite the code to solve bugs, performance issues, ... then anything else. Now we are going to rewrite a entire project ( AGAIN ) because whoever wrote it, had almost no experience. Welcome to the wonderful word of PHP programming. sigh. And not to dish East Europe programmers, there are just as many bad programmers in the West.
Maybe when you are used to more critical system programming, sure, your not going to run into messes like that often ( higher quality programmers, people with more experience ).
Sure, i have also seen horrible OO programming junk. But its in MY experience less then FP. So like i said, i do not understand why Krux02 disliked, what he called forced OOP. But yea, pull whatever i said out of context. I wanted to clarify in detail but yea, real life got in the way and i posted too fast.
You know, maybe i do not express myself perfectly but when people jump on every word this aggressively, it just pissed me off. Got better things to do then wast time on discussion that will simply lead to all parties wasting there time. You all win! You are all right! All happy!
Write whatever you want, i am out of here. So fed up with people jumping at every opportunity online to start useless discussions. If you have this much time, then put that time into freaking improving Nim's websites, documentation, etc.
Lesson learned. Never post on any freaking forum because its always a wast of time anyway. I am out of here!
I have yet to seen a single example of anybody using namespacing in functional programming. Then again, its relative "new" in PHP. rofl
PHP is all but a functional programming language. I think you are confusing terms here, functional programming languages are things like Haskell, Scheme or (to a lesser extent) LISP. Others provide some functional features in addition to imperative programming.
There are lots of programming languages which provide namespaces without being necessarily OOP. Nim itself uses namespaces, which map to filenames (like Python does). Ada has a package system which is the most feature-rich namespace implementation ever, without forcing the user to do OOP. Go uses directories as namespaces.
Yada yada yada ... typical forum bully tactics.
I have just answered to your arguments in a critical, but neutral way. This is quite the opposite of forum bully tactics, which include, amongst others, ad hominem tactics (like, for example, calling another user a forum bully).
Lets all wast hours fighting it out on a forum so one of use can both feel superior.
This is not and was never my intent. Where do you deduce this from? Because I criticized your arguments? This is what a discussion is for. If you do not want to discuss, there is no point in answering here.
There is always somebody who gets pissed or disagrees and then wants to wast hours discussing something that will not change both parties there opinion anyway.
I am not pissed. You seem to be. You even state that later in your post.
Bullshit first class. If you can not tell the different between a piece of OOP & FP code, then you really do not need to start arguing about it. Feeling superior yet?
As I said, you seem to confuse the term functional programming with imperative, procedural, non-OOP programming. I do not want to continue this discussion on a level where you just rely on personal attacks, thanks.