Show HN: Jevlang. delegate every if/while condition to Jev
Show HN: Jevlang. delegate every if/while condition to Jev RoyWiggins / jevlang Public Notifications You must be signed in to change notification settings Fork 0 Star 1 Branches Tags Open more actions menu Latest commit History 23 Commits 23 Commits Folders and files Name Name Last commit message Last commit date examples examples src src tests tests .gitignore .gitignore README.md README.md pyproject.toml pyproject.toml uv.lock uv.lock Repository files navigation jevlang Python where every if , elif , while and match (ternaries, list comprehension excepted) is decided by Jev , enabling modern coding style : conditionals no longer have to be Python at all: # coding: jevlang bottles = 99 while there are bottles left : print ( f" { bottles } bottles of beer on the wall" ) bottles -= 1 $ python examples/bottles.py 99 bottles of beer on the wall 98 bottles of beer on the wall ... In fact, unless you set JEVLANG_LOCAL_PYTHON=1, even Python conditionals are evaluated by Jev.
This Other is relevant to the technology intelligence record because it involves DeveloperTools activity. The source article should remain the factual reference for follow-up coverage.
- RoyWiggins / jevlang Public Notifications You must be signed in to change notification settings Fork 0 Star 1 Branches Tags Open more actions menu Latest commit History 23 Commits 23 Commits Folders and files Name Name Last commit message Last commit date examples examples src src tests tests .gitignore .gitignore README.md README.md pyproject.toml pyproject.toml uv.lock uv.lock Repository files navigation jevlang Python where every if , elif , while and match (ternaries, list comprehension excepted) is decided by Jev , enabling modern coding style : conditionals no longer have to be Python at all: # coding: jevlang bottles = 99 while there are bottles left : print ( f" { bottles } bottles of beer on the wall" ) bottles -= 1 $ python examples/bottles.py 99 bottles of beer on the wall 98 bottles of beer on the wall ...
- In fact, unless you set JEVLANG_LOCAL_PYTHON=1, even Python conditionals are evaluated by Jev.
- Setting this is otherwise known as "Luddite mode".
- How it works It's a source preprocessor built on Python's codec machinery (see Python's preprocessor ).
- Each block header becomes a call into the runtime with the condition's text, its line number, and locals() : while __import__ ( 'jevlang.runtime' ).
- cond ( 'while' , 'there are bottles left' , 3 , locals ()): At runtime the session gathers the variables in scope, the surrounding source (a few lines either side, with the current line marked) and how many times this line has been evaluated, and asks the backend for a decision.