feat(duckscript): duckscript page
continuous-integration/drone/push Build is passing Details

master
flavien 2023-01-03 18:00:20 +01:00
parent 60b3ca0655
commit 82c1a88860
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,34 @@
---
title: "🦆 duckscript interpreter"
description: "A tiny programming language made with rust"
date: 2023-01-03
summary: "A tiny programming language made with rust"
categories: ["posts", "rust", "web assembly", "programming language"]
---
## Code your own programming language 🏗️
> Long distance runners sometimes train with weights strapped to their ankles or at high altitudes where the atmosphere is thin. When they later unburden them- selves, the new relative ease of light limbs and oxygen-rich air enables them to run farther and faster.
> Implementing a language is a real test of programming skill. The code is complex and performance critical. You must master recursion, dynamic arrays, trees, graphs, and hash tables. You probably use hash tables at least in your day-to-day programming, but do you really understand them? Well, after weve crafted our own from scratch, I guarantee you will.
> -- <cite>ROBERT NYSTROM in CRAFTING INTERPRETERS</cite>
## Start little 🐛
The current version of duckscript does not implement a lot of features. It was above all an opportunity to learn PEG parsing grammar and the basics of abstract syntax tree and interpreter.
I would have liked to add more useful features like strings, function and print, but I have certifications to pass for work.
It remains a side-project that I would like to resume as soon as possible.
**Currently implemented:**
- number (i64), boolean
- \+ \- \* / % arithmetic operators
- < > <= >= == != && || ! boolean operators
- variables
- if else conditional, while loop, break keyword
<br>
*Implemented with pest.rs for parsing and egui for ui*
*The environment persists until you click on reset*
{{< egui "/iframe/duckscript/index.html" >}}
## look at the code! 🤓
[@coincoingit repo](https://coincoingit.fr/flavien/Ducklang "Coincoingit: un coincoin pour votre code").

@ -1 +1 @@
Subproject commit 6f216cecd905682c6aa2a77b3f4b7763626935ed
Subproject commit eb5151017af913fbae6adf4f01484fd9571c6e59