Skip to content

Instantly share code, notes, and snippets.

@tarcieri
Created August 7, 2013 05:56
Show Gist options
  • Save tarcieri/6171587 to your computer and use it in GitHub Desktop.
Save tarcieri/6171587 to your computer and use it in GitHub Desktop.
A crazy idea
# Reclaim Ruby's global variable syntax for type annotations!
# This could be done with a transpiler similar to TypeScript
def hello($String who)
puts "Hello, #{who}"
end
hello("world!")
@peterc
Copy link

peterc commented Aug 7, 2013

I like this. (Despite having one "app" that uses global variables quite heavily - oh the shame, the shame..)

I think Ruby is quite ripe for having some sort of TypeScript-esque transpiler for a variety of things. One of my choices would be supporting significant whitespace to kill all the "end; end; end; end" stuff.

@mattly
Copy link

mattly commented Aug 7, 2013

+1 to types and +1 to using whitespace to kill "end; end; end"

@locks
Copy link

locks commented Aug 7, 2013

Ruby and whitespace isn't enough of a problem for significant whitespace not to be added in pronto.

@haileys
Copy link

haileys commented Aug 7, 2013

@peterc This solves the whole 'end; end; end; end' problem: https://bugs.ruby-lang.org/issues/5054

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment