Live data from Hacker News

InfraRuby 3.7 – Compiler and runtime for statically-typed Ruby

infraruby.com

1–10 of 23 posts

Re: InfraRuby 3.7 – Compiler and runtime for statically-typed Ruby

#4
"Statically-typed Ruby" that isn't actually Ruby, but a subset of Ruby[1] + mandatory type annotations. A rather misleading title.

E.g. here's an example [2], with stuff like this:

        ## java.lang.String -> void
	def set_title(title)
		@title_view.setText(title)
		return
	end
I kinda doubt this will take off with most Ruby users. Though being able to use something quite close to Ruby to write native Android apps is somewhat appealing even with extra pain (RubyMotion seems nicer to me, but the compiler only runs on OS X).

[1] "The runtime implements selected methods from core classes" [long list omitted]

[2] http://webcache.googleusercontent.com/search?q=cache:sUdn7y_...

Re: InfraRuby 3.7 – Compiler and runtime for statically-typed Ruby

#7
post #4

"Statically-typed Ruby" that isn't actually Ruby, but a subset of Ruby[1] + mandatory type annotations. A rather misleading title. E.g. here's an example [2], with stuff like this: ## java.lang.String -> void def set_title(title) @title_view.setText(title) return end I kinda doubt this will take off with most Ruby users. Though being able to use something quite close to Ruby to write native Android apps is somewhat a…

> "Statically-typed Ruby" that isn't actually Ruby

Yes, "statically-typed Ruby" != "Ruby".

> but a subset of Ruby

Necessarily (because "statically-typed"). You can see the supported methods here: http://infraruby.com/reference

Re: InfraRuby 3.7 – Compiler and runtime for statically-typed Ruby

#8
How does this compare to Crystal[1]? Crystal is very clear that it compiles to native [2].

Tried to figure out what InfraRuby compiles to, but no avail. Is it to JVM?

[1] http://crystal-lang.org

[2] Very impressive result actually. It only performs ~3x slower on a basic Monte Carlo Tree Search compared to Nim, which itself is ~c speed.

Re: InfraRuby 3.7 – Compiler and runtime for statically-typed Ruby

#9

How does this compare to Crystal[1]? Crystal is very clear that it compiles to native [2]. Tried to figure out what InfraRuby compiles to, but no avail. Is it to JVM? [1] http://crystal-lang.org [2] Very impressive result actually. It only performs ~3x slower on a basic Monte Carlo Tree Search compared to Nim, which itself is ~c speed.

> How does this compare to Crystal?

You can use InfraRuby code with a Ruby interpreter: http://infraruby.com/blog/why-infraruby

> Tried to figure out what InfraRuby compiles to, but no avail.

Sorry, that should be made clearer...

> Is it to JVM?

Yes! ruby.Object extends java.lang.Object: http://infraruby.com/reference/Object

Re: InfraRuby 3.7 – Compiler and runtime for statically-typed Ruby

#10
post #6

Finally a solution that can makes Rails more competitive

If you can find anyone willing to port Rails to a statically typed subset that requires adding type annotations and also porting every single gem it depends on....

Well that is a starting point. It would be even harder without it so better having it that not. Also do you have any alternatives?

Maybe for a start, making a statically typed Sinatra rather than Rails would be a more affordable task.

But anyway I'm not sure this is the right direction for Ruby as I think that more radical and different changes are needed to extract the full potential out of it.

Anyway if Infrared proves to be a nice and quick alternative solution that will let us gain back some lost terrain in those situations where Ruby was discarded because of performance, then I more then welcome it, hoping that a some point the efforts put in it will somehow also be useful to Ruby MRI (or whatever the Ruby reference implementation will be at that time) improvement..

Post reply on HN