Any plan for static type checker?

Hey,

I've been playing around with Rhombus for a little while now and I really like the language. One aspect of it that I find really neat is the static information bindings. I'm curious if there is any plan to allow them to work as a fully static type checker. For example in this code

#lang rhombus/static

fun func(a :: Int):
  a + 1

println("hello")
func("hello")

it seems that the annotation is not checked until func is being executed with the wrong annotation. It would be really nice if it could catch this before executing any code.

You may be interested in the (less mature) Shplait. It “syntactically resembles the Rhombus language, but the type system is close to that of ML.”

1 Like

This seems super close to what I want. Unfortunately it seems maps have to be access through map_get instead of using #%index. Also seems like there is no support for classes/interfaces.

I'll play around with it though and see if its more my jam. The lack of static checking in Rhombus for things it should be able to statically check is bothering me a bit :stuck_out_tongue:

I would not say that Shplait is on the direct path to a Typed Rhombus. It's an experiment that could inform a future Typed Rhombus in the way that type constraints are gathered for a finishing unification pass. Otherwise, though, it's a domain-specific language that's intentionally limited.

Typed Rhombus is definitely of interest, but I don't know of a specific plan to get there, as yet.

5 Likes