Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Awesome, I love messing with Ruby and semantic web stuff. Thanks for posting this. Could you explain more? How do you implement the strongly-typed feature? How does it interoperate with the Ruby-RDF library? https://github.com/ruby-rdf


sort by: page size:

Thanks for the in-depth explanation. Sounds really great. I'll add it to my Ruby RDF toolkit.

What do you think of Spira https://github.com/ruby-rdf/spira , does it complement what you are doing in any way?


I've been developing a strongly-typed Ruby library for generating JSON-LD that might be interesting or useful: https://github.com/public-law/schema-dot-org

A few years ago I wrote a Ruby example if anyone wants to try it: https://github.com/aw/ruby-decision-table

Ruby 3 supports type signatures: https://github.com/ruby/rbs

There essentially already is a statically typed ruby: Crystal.

https://en.wikipedia.org/wiki/Crystal_(programming_language)


I came across a library for persistent data structures in Ruby yesterday: http://github.com/harukizaemon/hamster

I just started working on a similar library for Ruby:

https://github.com/tarcieri/http


It's not exactly what you want, but if you want a statically typed ruby-like you should check out crystal (http://crystal-lang.org/)

Actually, that's already happening[1]. Also note that there is a library for "ruby contracts[2]" (which I didn't try yet, but I'm very eager to do so) which could give the same result as a statically typed language.

[1] https://www.omniref.com/blog/blog/2014/11/17/matz-at-rubycon...

[2] http://egonschiele.github.io/contracts.ruby/.


I played with this [1] when I first started programming in Ruby. The results were super interesting (but now I regret not using the Wikipedia API...)

[1] https://gist.github.com/1654064


If you like this a bit more formalized, take a look at Semantic Versioning ( http://semver.org/ ).

That's one of my primary issues with Ruby.


FYI: For an alternative ruby (subset) with type annotations today see sruby, that is, secure ruby - https://github.com/s6ruby

Funny enough I started something like that as a ruby library and stopped when I got to the query language shim because I just ran out of time and motivation. https://github.com/wa9ace/squongo

I've not personally tried it, but I remember thinking rdl sounded promising after seeing this talk (looks like there's a video online): https://www.thestrangeloop.com/2017/type-checking-ruby.html

Sorbet[0] is probably the closest to what you're looking for. It's not something I would recommend to someone who wants to get started with Ruby, since it would be limiting to learn it as if it was a statically typed language.

[0] https://sorbet.org/


I rolled my own version of this plus a few more features a few months ago in Ruby. https://github.com/aewens/gitgot

Got it. FWIW, I don't particularly care for Ruby; for that style of programming I usually use Lua, whose syntax and semantics are quite simple.

The existence of LuaJIT (http://luajit.org/luajit.html) supports your argument, I think.


Check out Crystal - Its statically typed, compiled, and a near one to one implementation of Ruby. https://crystal-lang.org

> I would definitely find what curryhoward described as useful

You can get a statically-typed Ruby here: http://infraruby.com/live

It follows Java's type system (including generics with bounded wildcards) but it doesn't support Ruby reflection.

next

Legal | privacy