r/vibecoding • • Apr 07 '26

[Showcase] I built a DSL-based framework for "Vibecoding": Building a reactive Tic-Tac-Toe with zero JS and pure logic pipes.

Hi everyone!

I’ve been working on an experimental framework because I’m tired of seeing business logic tangled up with UI code. I wanted to see if I could create a fully reactive game using zero JavaScript in the application layer.

The Tech Stack:

  • XML for UI: A purely declarative layout. It handles design via built-in attributes (like matter="glass", radius, shadow). No CSS files needed.

  • DLS for Logic: A custom Domain Specific Language that acts as a message broker.

The Highlight (Tic-Tac-Toe Logic):

In the video, you can see how I handle the win-condition. Instead of writing imperative JS functions, I used a Pipe operator (|>) and a Switch pattern directly in the DSL to evaluate the board state and trigger reactive updates.

Current Features:

  • Reactive Data Binding: The UI "binds" to logic domains and updates automatically.

  • Pipeline Logic: Actions can trigger a chain of events (e.g., play_cell -> check_victory).

  • Built-in Design System: High-level attributes for rapid prototyping.

Disclaimer:

This is an early alpha. Many features are still missing and there are definitely bugs. I'm building this to simplify the development of internal tools and data-driven dashboards.

<Window type="page" title="Tic-Tac-Toe / Gioco del Tris">
    <Container padding="40px" background="linear-gradient(#0f172a, #1e293b)" min-height="100vh" align="center" justify="center">
        <Column background="rgba(30, 41, 59, 0.7)" padding="32px" radius="24px" border="1px,rgba(255,255,255,0.1)" matter="glass" shadow="large" width="500px" align="center" spacing="24px">
            
            <Column align="center" spacing="8px">
                <Text size="32px" color="rgba(255,255,255,0.9)" font="bold">Gioco del Tris</Text>
                
                <Row align="center" spacing="8px">
                    <Text size="18px" color="#94a3b8">Turno attuale:</Text>
                    <Text id="turn_display" bind="tris:tris_logic.turn" size="24px" color="#38bdf8" font="bold">
                        {{ tris_logic.turn|default('X') }}
                    </Text>
                </Row>


                <Text id="winner_display" bind="tris:tris_logic.winner" size="30px" color="#10b981" font="bold">
                    {{ 'Vincitore: ' + tris_logic.winner|default('') }}
                </Text>


            </Column>


            <!-- Board -->
            <Grid style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 300px; height: 300px;">
                <Action click="tris:tris_logic.play_0" id="btn_0" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_0" bind="tris:tris_logic.c0" size="48px" font="bold" color="white">{{ tris_logic.c0|default('') }}</Text>
                </Action>
                <Action click="tris:tris_logic.play_1" id="btn_1" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_1" bind="tris:tris_logic.c1" size="48px" font="bold" color="white">{{ tris_logic.c1|default('') }}</Text>
                </Action>
                <Action click="tris:tris_logic.play_2" id="btn_2" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_2" bind="tris:tris_logic.c2" size="48px" font="bold" color="white">{{ tris_logic.c2|default('') }}</Text>
                </Action>


                <Action click="tris:tris_logic.play_3" id="btn_3" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_3" bind="tris:tris_logic.c3" size="48px" font="bold" color="white">{{ tris_logic.c3|default('') }}</Text>
                </Action>
                <Action click="tris:tris_logic.play_4" id="btn_4" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_4" bind="tris:tris_logic.c4" size="48px" font="bold" color="white">{{ tris_logic.c4|default('') }}</Text>
                </Action>
                <Action click="tris:tris_logic.play_5" id="btn_5" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_5" bind="tris:tris_logic.c5" size="48px" font="bold" color="white">{{ tris_logic.c5|default('') }}</Text>
                </Action>


                <Action click="tris:tris_logic.play_6" id="btn_6" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_6" bind="tris:tris_logic.c6" size="48px" font="bold" color="white">{{ tris_logic.c6|default('') }}</Text>
                </Action>
                <Action click="tris:tris_logic.play_7" id="btn_7" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_7" bind="tris:tris_logic.c7" size="48px" font="bold" color="white">{{ tris_logic.c7|default('') }}</Text>
                </Action>
                <Action click="tris:tris_logic.play_8" id="btn_8" background="#1e293b" radius="16px" border="1px,rgba(255,255,255,0.1)" pointer="pointer" width="100%" height="100%" align="center" justify="center">
                    <Text id="t_8" bind="tris:tris_logic.c8" size="48px" font="bold" color="white">{{ tris_logic.c8|default('') }}</Text>
                </Action>
            </Grid>


            <Divider background="rgba(255,255,255,0.05)" margin="16px,0" width="100%" />


            <Action click="tris:tris_logic.reset_btn" id="btn_reset" background="#38bdf8" color="#0f172a" padding="12px,32px" radius="12px" font="bold" pointer="pointer">
                Ricomincia Partita
            </Action>


        </Column>
    </Container>
</Window>

The framework is written in python.

1 Upvotes

0 comments sorted by