DEV Community

Cover image for Strictly Typed Functional Programming for Roblox
Jesse Warden
Jesse Warden

Posted on • Originally published at jessewarden.com

3 2

Strictly Typed Functional Programming for Roblox

I managed to get Hypatia, an Elm and PureScript like typed Functional Programming language that compiles to Lua, running in Roblox. Roblox is a 3D game engine that has a ton of already built games and editor where games are built in Lua. My kids spend way too much time and our money in it. I couldn’t get Amulet, another similar language, too compile, but Hypatia “spoke to me” more. Advent of Code 2020 this year taught me dealing with no types and race conditions is painful. I really wanted to explore what other language options there are that compile to Lua.

The workflow is you write in Hypatia, compile, make the compiled Lua require statements to the Roblox version, and Rojo, a Rust built development tool, will sync your Lua directly into Roblox. You can then call the exposed functions directly from other Lua (i.e. Buttons, events, etc). I’m thinking of automating that require change with Python… or maybe Lua.

Compiling Hypatia required a couple of smart Haskell devs at work to help me compile. Cabal didn’t work but Stack worked no problem on my Mac M1. Hypatia might compile JavaScript too, not sure.

Anyway, still need to figure out side effects (still learning what the heck a f -> Unit is), and how to deal with coroutines and various other side effects since Hypatia doesn’t handle them like Elm does, but super excited to continue exploring this.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (1)

Collapse
 
cipharius profile image
Valts Liepiņš

Hah, did not expect to see roblox on dev! That's where I began learning programming ~11 years ago.

Hypatia seems neat, nice find! I've joked about coding roblox game in Haskell like language, but now it actually is possible.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay