topazproject / topaz Goto Github PK
View Code? Open in Web Editor NEWA high performance ruby, written in RPython
Home Page: topazruby.com
License: BSD 3-Clause "New" or "Revised" License
A high performance ruby, written in RPython
Home Page: topazruby.com
License: BSD 3-Clause "New" or "Revised" License
This doesn't parse
puts 1, :hi => :ho
puts(1, :hi => :ho)
Should be equivalent to
puts(1, {:hi =. :ho})
The following code fails to parse:
a, *b = [1, 2, 3]
Expected outcome is
a => 1
b => [2,3]
This should print, but doesn't
if nil
puts "shouldn't print"
elsif nil
puts "shouldn't print"
else
puts "should print"
end
Specifically the "#{x}"
syntax.
You can see this at fileutils.rb:1278
:
Dir.entries(path(), opts)\
.reject {|n| n == '.' or n == '..' }\
.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
There's an implementation in tim/support-__END__
branch, but one thing is missing: the DATA constant should only be set in the top-level Ruby script
This is because utils:format_traceback
tries to read values from exc.frame
, but it was never set because the RubyError
was raised outside of the interpreter.
Occurs at fileutils.rb:276
:
begin
rescue E1, E2
end
This prevents lib/mspec/commands/mspec.rb
from loading (assertion error in rupypy/parser.py, line 55, in visit_send_block
)
A simple example where it breaks is this:
options.version MSpec::VERSION do end
These variants work:
options.version(MSpec::VERSION) do end
options.version VERSION do end
Example:
each do end
But this works:
self.each do end
ATM, they're just ignored which leads to a parsing breakdown on lines like:
"#{name} #{parameters.join(", ")}"
These should all propogate their effect into an outer scope, somehow.
That should generate a block, taking one argument, and applying the method :symbol yo each argument.
Specifically a bunch of the operator methods don't work.
Specifically at fileutils.rb:203
return *list if options[:noop]
Subtraction is an example:
2 - 3 - 4
This should evaluate to -5
, but we emit 3
.
MRIs factorial benchmark doesn't run with the current limit (recursing 5000 times). It'll have to, eventually, if only for the Ruby shootout.
Needed for fileutils.rb Should return the current line in the file.
Current master fails to parse the following mspec files
/home/tim/Devel/projects/pypy/rupypy/scripts/../../mspec/lib/mspec/guards/version.rb
/home/tim/Devel/projects/pypy/rupypy/scripts/../../mspec/lib/mspec/guards/platform.rb
/home/tim/Devel/projects/pypy/rupypy/scripts/../../mspec/lib/mspec/runner/formatters/junit.rb: line 55
/home/tim/Devel/projects/pypy/rupypy/scripts/../../mspec/lib/mspec/runner/formatters/spinner.rb: line 7
/home/tim/Devel/projects/pypy/rupypy/scripts/../../mspec/lib/mspec/utils/name_map.rb: line 78
<<-EOS
private :#{name}
EOS
ec.space.execute(ec, "return Symbol.all_symbols")
fails with "uninitialized constant Symbol". However, ec.space.execute(ec, "return :abc.class.all_symbols")
works as expected.
Add support for the alias statement.
e.g.
module M
end
class M::A
end
Note: This is not the same as
module M
class A
end
end
The constant lookup (due to different static scope) is different for those two cases
This doesn't work on Rupypy
class A
def self.get
1
end
end
class B < A
end
B.get # => 1
Constant lookup should use the static scope, not the dynamic scope
class A
CONST = "a"
def get
CONST
end
end
class B < A
CONST = "b"
end
A.new.get == B.new.get # => should return true
They are not supported
def foo *args
end
When you do something like
case foo
when 1, 2
puts 5
end
the body puts 5
actually gets duplicated in the bytecode, this shouldn't happen
Used in mspec/lib/mspec/runner/context.rb:187
The support for combinations of explicit/implicit super and splat and block arguments is not perfect.
Meaning stuff like
:"@#{name}"
Kills mspec -h
Currently these are just ignored.
Currently all methods are public
Tests are way too slow ATM. At a minimum they should be 10x faster (for running all tests), than they are now, and I'd like 20x.
bench_red_black.rb (requires Timer branch): https://gist.github.com/3282136
Not much to go on...here's output:
system ~/projects/rupypy $ ./topaz-c bench_red_black.rb
Segmentation fault: 11
Examples include
$!, $"
We need to just go through the list and all of them
loop do
puts 1
break
end
Required for rubyspec/spec_helper.rb:40
Include should modify the inheritance, not the method dictionary.
Appears at fileutils.rb:1277
opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
Required for mspec/lib/mspec/utils/version.rb:51
The following illustrates the problem
a = []
a << [2]
a # => [[2]]
$a = []
$a << [2] # => error
They aren't supported. I believe their semantics are a straight forward conversion to a SEND_BLOCK
.
This code illustrates the problem
def foo(n)
n - 1
end
puts foo 1
def bar(n)
n-1
end
puts bar 1
I have wrong implementations for some of them, which I can't push as they are, so this is to track the list of missing methods. It just takes a while to compile (what with mspec running for 5 minutes before throwing a NoMethodError ;)) so I thought it's a good idea to track them so someone doesn't have to find out the hard way, again :)
Methods
String#[]
, String#dup
, String#ljust
, String#split
, String#=~
Object#hash
Array#pop
, Array#shift
, Array#dup
, Array#concat
, Array#empty?
Kernel#block_given?
Enumerable#detect
, Enumerable#any?
File.join
, File.exist?
, File.join
, File.executable?
, File.directory?
Dir.delete
Kernel#exit
, Kernel#exec
, Kernel#at_exit
IO#puts
Classes
Constants
Keywords
super
, next
, break
Stdlib
Parsing Errors
mspec/runner/formatters/junit
... + my open PRs :)
The good news is, that after hacking my way through/around all these, I get the help text :)
It's apparently really just a local return inside a block.
This is a small test case
def broken
each {
saved_env = 1
each { saved_env }
each { saved_env }
}
end
It works if one of the inner blocks is removed, or saved_env
is defined in the top-level function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.