Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to implemet a Ruby-like internal DSL in Python?

Tags:

python

ruby

dsl

Is it possible to implement an internal DSL in a language without macros? Has anyone succeeded in implementing a Ruby-like internal DSL in python?

I am trying to develop a simple state machine with a more intuitive syntax like:

start -> Event -> Next ->Action 
like image 713
mossplix Avatar asked Apr 29 '26 23:04

mossplix


1 Answers

I am having a bit of trouble grokking your question.

AFAIU, you are asking

Can you implement a Ruby-like internal DSL in a language without macros?

And the answer to that is obviously "Yes", since Ruby doesn't have macros.

like image 95
Jörg W Mittag Avatar answered May 01 '26 11:05

Jörg W Mittag



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!