Hi
Can ruby replace c ? Or no, because ruby is a high level language !!
Can ruby write inline assembly?
Does ruby have linker script, so i can link any piece to a specific
address, i need this often in driver programming.
In c, if i declare char[100], it consume 100 bytes, if in ruby, does
it have a datatype that represent one byte? I heard everything in ruby
is object, no exception, so the answer should be no.
Does ruby have pointer? a cpu-specific pointer? In 32 bit CPU,
pointer is 32 bits, in 16 bit CPU, pointer is 16 bits.
Hi
Can ruby replace c ? Or no, because ruby is a high level language !!
Can ruby write inline assembly?
IIRC there is a project that allows incline C or assembly code. Someone
with more specific memory out there?
Does ruby have linker script, so i can link any piece to a specific
address, i need this often in driver programming.
Well, you can write C extensions. And there you can do pretty much
everything C allows (if you respect some caveats, as mem allocation etc.).
In c, if i declare char[100], it consume 100 bytes, if in ruby, does
it have a datatype that represent one byte? I heard everything in ruby
is object, no exception, so the answer should be no.
This is the closest you can get
s = "\000" * 100
Does ruby have pointer? a cpu-specific pointer? In 32 bit CPU,
pointer is 32 bits, in 16 bit CPU, pointer is 16 bits.
No. And you don't need them and cannot use them in Ruby. You would have
to deal with this in an extension.
irb(main):001:0> i = 0; "c".upto("ruby"){ i += 1 }; p i
330639
So there are quite a few iterations left before C will become Ruby (and,
given that D has been around for quite some time and hasn’t become even
close to finished, I’m guessing that the answer is “no”),
nikolai
···
--
Nikolai Weibull: now available free of charge at http://bitwi.se/\!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Ruby is an interpreted high level language. You can do a lot of C-like things
in Ruby, but due to performance reasons, Ruby won't replace C, at least until
we have an extremely efficient compiler. It is a perfect language for many
things however.
···
On Wednesday 05 October 2005 21:14, Robby Russell wrote:
On Thu, 2005-10-06 at 12:11 +0900, cmk128@hotmail.com wrote:
> Hi
> Can ruby replace c ? Or no, because ruby is a high level language !!
irb(main):001:0> i = 0; "c".upto("ruby"){ i += 1 }; p i
330639
So there are quite a few iterations left before C will become Ruby (and,
given that D has been around for quite some time and hasn’t become even
close to finished, I’m guessing that the answer is “no”),
nikolai
This one really cracked me up! The first time I see a joke written in a programming language!!!
I am starting to wonder what languages will look like when we hit the
Z programming language. Theoretically it is all over then, I mean we
are out of letters unless we start using Greek or Russian or Japanese
characters.
Although would you really want to program in the beta language? Or
alpha for that matter?
Mitch
···
On 10/6/05, Christophe Grandsire <christophe.grandsire@free.fr> wrote:
En réponse à Nikolai Weibull :
>
>>Can ruby replace c ?
>
>
> irb(main):001:0> i = 0; "c".upto("ruby"){ i += 1 }; p i
> 330639
>
> So there are quite a few iterations left before C will become Ruby (and,
> given that D has been around for quite some time and hasn't become even
> close to finished, I'm guessing that the answer is "no"),
> nikolai
>
This one really cracked me up! The first time I see a joke written in a
programming language!!!
--
Christophe Grandsire.
irb(main):001:0> i = 0; "c".upto("ruby"){ i += 1 }; p i
330639
So there are quite a few iterations left before C will become Ruby
(and,
given that D has been around for quite some time and hasn’t become even
close to finished, I’m guessing that the answer is “no”),
nikolai
This one really cracked me up! The first time I see a joke written in
a programming language!!!
Linux only AFAIK (at least, it doesn't work for me on WinXP + VC7)
Windows is problematic since you'll need the compiler you built Ruby with
for the RubyInline stuff to work.
It's just fine on Mac's and other unix/linux boxen though.
--
email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna
I am starting to wonder what languages will look like when we hit the
Z programming language. Theoretically it is all over then, I mean we
are out of letters unless we start using Greek or Russian or Japanese
characters.
I was wrong - it almost works with the One-Click Installer version. I
just didn't try hard enough.
The problem appears to be that it isn't picking up msvcrt-ruby18.lib
on the LINK step. It compiles when I copy the cl command line from the
error output and add the lib like so:
I am starting to wonder what languages will look like when we hit the
Z programming language. Theoretically it is all over then, I mean we
are out of letters unless we start using Greek or Russian or Japanese
characters.
I am starting to wonder what languages will look like when we hit the
Z programming language. Theoretically it is all over then, I mean we
are out of letters unless we start using Greek or Russian or Japanese
characters.
I am starting to wonder what languages will look like when we hit the
Z programming language. Theoretically it is all over then, I mean we
are out of letters unless we start using Greek or Russian or Japanese
characters.
Z does exist but is a program specification language, a terrible thing
that you learn in university. Eiffel is a real language based on Z. So
we are just adding one or two more letters to the language name.
···
--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's
class X
inline(:C) do |builder|
builder.add_link_flags "whatever"
# ...
end
end
It is fairly well documented. Just generate the rdoc and poke around.
The better route to go is to build your own ruby and it'll pick up all the things it needs automatically.
Read rbconfig.rb for where we get all our building information.
···
On Oct 6, 2005, at 5:08 PM, Sean O'Halpin wrote:
On 10/7/05, Eric Hodel <drbrain@segment7.net> wrote:
No, it should work on Windows too provided you built your own Ruby.
You may need to set some ENV vars as well (like HOME or INLINE_DIR).
I was wrong - it almost works with the One-Click Installer version. I
just didn't try hard enough.
The problem appears to be that it isn't picking up msvcrt-ruby18.lib
on the LINK step. It compiles when I copy the cl command line from the
error output and add the lib like so:
cl -nologo -LD -MD -Zi -O2b2xg- -G6 -I
c:/ruby/lib/ruby/1.8/i386-mswin32 -o Inline_MyTest_cb89.so
Inline_MyTest_cb89.c msvcrt-ruby18.lib -link /INCREMENTAL:no
/EXPORT:Init_Inline_MyTest_cb89
(with c:\ruby\lib added to the LIB environment variable) but how do I
get RubyInline to do this?