Another potential language choice for tuning

Free Open Source Software project discussion forum. Post your Free Open Source software projects here!
Post Reply
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Another potential language choice for tuning

Post by Fred »

Ruby. I've been looking into this recently to up-skill myself for employment reasons as it is a popular web development tool right now and a pretty cool language by the sounds of it.

I just downloaded and setup this demo far more quickly than I had the mono app running in :

http://www.arachnoid.com/ruby/RubyGUIProject/

It uses QT like Marcos' tool does.

The code is quite unlike Java/C#/C/C++ etc, for example, this is all that is required in the source file to output something, get user input and reoutput it. Notice the lack of data types :

Code: Select all

puts "Hello World! What is your name?
name = gets
puts "Hello " + name
Fairly different indeed. Should be fun though. 6 months ago I had no idea about how to use C effectively, now I do. In 6 months if I keep up with this I should be able to use it effectively too.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
shameem
LQFP112 - Up with the play
Posts: 135
Joined: Thu May 01, 2008 6:30 pm
Location: Ann Arbor, MI
Contact:

Re: Another potential language choice for tuning

Post by shameem »

User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Another potential language choice for tuning

Post by Fred »

I've been doing a lot of reading and not a lot of ruby coding, but I thought I'd post my first little program here :

Code: Select all

def allwords(stringofwords)
        splitwords = stringofwords.split
        outputwords = []
        splitwords.each do |aword|
                outputwords << aword.capitalize + " "
        end
        outputwords = outputwords.join
        outputwords["Testing"]= "Production"
        outputwords.strip
end

somewords = "some words in a sentence that i like to use for testing!"

puts somewords

puts allwords somewords

puts somewords
Which produces the following output :

Code: Select all

fred@rwdlsd:~$ ruby allw.rb
some words in a sentence that i like to use for testing!
Some Words In A Sentence That I Like To Use For Production!
some words in a sentence that i like to use for testing!
Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
BenFenner
LQFP144 - On Top Of The Game
Posts: 360
Joined: Wed Jul 09, 2008 3:15 pm

Re: Another potential language choice for tuning

Post by BenFenner »

I learned Ruby pretty well for a Ruby on Rails senior project I did. Made a trading website combining the visual appeal of eBay and the no-nonsense content of craigslist. I promptly forgot Ruby immediately after.

It's a nice language, I enjoyed it enough. I'm the kind of guy who needs to be 100% comfortable with the compilation of a language before I feel comfortable using it. If I can't step through code and compile it in my head I get frustrated. I never got to that point with Ruby.
garwor
TO92 - Vaguely active
Posts: 1
Joined: Wed Jul 16, 2008 1:21 pm

Re: Another potential language choice for tuning

Post by garwor »

Hi guys,
i see you looking for right programming language, i would recomend java because of cross-platform portability, and also development environments are free. Requires some better programming skills than some Ruby or similar languages you mentioned here, but generaly causes better modularization and reusability.
I'm developer many years, don't drive tunned cars, but become interested in engine management tools because some friends are working in tunnings, and i wanted to make program for this issues. And i see that you have same goal, maybe i can contribute to your project.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Another potential language choice for tuning

Post by Fred »

Awesome :-) I'm a java guy at heart too, but it's been suggested to me that using Java is too heavy weight. Mono and C# is almost as good a choice as Java, but the library availability for Java is second to absolutely none, so the Java app *should* win out in every case really. Java performance is excellent too despite what some people believe.

I'm playing with Ruby to broaden my commercial appeal as an employee you see, and because it looks like it would be fun to play with too. I've never used any "functional" languages before, so it's about time I cut my teeth on one :-) might as well make it a commercially appealing up and coming one while I'm at it I think.

Check out ECUManager in the tools section. Another member wrote that for his private project and has released it under GPL, It might interest you.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
BenFenner
LQFP144 - On Top Of The Game
Posts: 360
Joined: Wed Jul 09, 2008 3:15 pm

Re: Another potential language choice for tuning

Post by BenFenner »

I feel most comfortable in Java, or anything Java-like (C# comes to mind). I wouldn't dare use it for an embedded system though.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Another potential language choice for tuning

Post by Fred »

Yeah, C# is just the evil cousin :-)

I don't mind any of C, C++, C#, Java, but I've never used any functional languages like python or perl or ruby, so nows the time. I've got an interview lined up for a Java position in the next few days, but I think I'll stick with ruby anyway as it's another notch in the belt regardless :-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
PhatBobq
TO92 - Vaguely active
Posts: 1
Joined: Sat Aug 09, 2008 8:53 pm

Re: Another potential language choice for tuning

Post by PhatBobq »

Embedded Java ain't such a bad idea - garbage collection is a nice insurance for a system thats going out into mass production. I've done a few embedded Java contracts, and if they're written properly (sparse code, minimal threads, and a decent, structured JNI layer) they work well.

Sun are touting Real Time Java now: http://java.sun.com/javase/technologies/realtime/

The last exciting job I had (6 years ago) I was working with an invention by a company called Vulcan Machines who had a Java processor - it used the same byte code that the Java VM used, and had hardware based garbage collection. Like all .com era stuff it was cool but pointless!
Post Reply