| roblox-py v3 | Python to Luau compiler

roblox-py v3.0.0

playground | v2 | discord

roblox-py is a project I started a while ago to be a compiler for Python to Luau, it was meant to be an experiment but gained a lot of traction, The previous versions were not Production Ready in any way, this version is supposed to change that.

This current version is not in #resources because it still needs to undergo some changes before I fully release it until then you can try out the playground listed above.

Changes

  • Rewritten from the ground up
  • Yield From supported
  • del supported
  • More operators
  • Classes
  • Typechecker
  • A lot of bug fixes
  • Faster compiler
  • try, catch, finally
  • staticmethods and classmethods
  • Optimized code
  • Playground
  • New interface/CLI
  • Match statements
  • Indexs start at 0
  • Set, List, and Dict comprehension
    ex: squares = {x**2 for x in range(1, 11)}
  • Custom types
  • f-strings
  • Default arguments
  • Connect to events using decorators
  • Import services like import game.Workspace as WK and automatically have :GetService used in generated code
  • raise
  • Automatic generated exports and the end of the file
  • yield
  • All standard python functions implemented
  • await

8 Likes

Try fixing this!

image

Code inputted:

from game.ReplicatedStorage import ModuleScript

Try

import game.ReplicatedStorage.ModuleScript

import imports a full modulescript, from import imports a function, or table, or value from a modulescript. This isn’t a bug but is intentional.

1 Like

This is cool (I like how it compiles in real-time in the playground, most online IDEs don’t). Given that standard Python contains std io functions [input etc…] do you plan to add deeper io support for Luau somehow? I noticed input may not be supported.

Also, makes me appreciate list comprehension even more lmao

The python standard functions are supported in the CLI using the -f argument, I might add a checkbox to the Playground to let you add that in the playground

1 Like

Just fixed a bug in the playground where the footer may not change from the previous users session.

v3 is officially out!!! Download the executables in Github Releases.