elliotchance / bento Goto Github PK
View Code? Open in Web Editor NEW🍱 bento is an English-based automation language designed to be used by non-technical people.
🍱 bento is an English-based automation language designed to be used by non-technical people.
declare person is composite of first-name is text, last-name is text
declare names is array of text
Allow a comma to be followed by a new line, like:
If it is the afternoon,
display "Good afternoon, {persons-name}!",
otherwise display "Good morning, {persons-name}!"
Say hello to persons-name (persons-name is text):
display "Good afternoon, {persons-name}!"
They should not be mixed in with other sentences
Just some basic functionality.
display (counter + 1)
Only variables and arithmetic will work.
Binary builds for windows, mac and linux.
Bento looks really interesting...
Can Bento be used with something like Bash Shell scripts?
What I mean is can Bento call a Bash script
or
Can a Bash script call a Bento program?
Or is that what "a backend" is about?
A backend is program controlled by bento. A backend can be any program (compiled or interpreted) that implements the bento protocol on the port specified on the BENTO_PORT environment variable.
If Bash can be used could you give an example of calling a Bash script and perhaps returning a "value" from the script?
thanks
brian
At the moment it is hard coded to 6.
Start:
Declare I is number
Until I reached limit, display I
Counter reached limit (counter is number)?
If counter = 10, yes, otherwise no
square root ? into ?
# etc
When a parsing error occurs it should show the line/character.
Still trying to work out what error handling will look like, here is a rough idea:
start:
declare last-order-date is text
# one line
try to fetch last order date into last-order-date, on no-orders set last-order-date to "unknown", on missing-order display error-message, always display "Fetched order date"
# one line with better spacing
try to fetch last order date into last-order-date,
on no-orders set last-order-date to "unknown",
on missing-order display error-message,
always display "Fetched order date"
# multiline
try
fetch last order date into last-order-date
display "Fetched order date"
catch no-orders, set last-order-date to "unknown"
catch missing-order do
display error-message
end
fetch last order date into dest (dest is text):
raise error no-orders
raise error missing-order with the message "Where did it go?"
bento format
to format files like go fmt
works.
run system command "echo hello" ...
output into echo-result
if (foo = 123) and (bar != “baz”), ...
Conditions must be in parenthesis. This means we don’t have to worry about operator precedence and it’s more explicit so it’s much easier to parse and understand.
These are used in decisions and loops for a block of statements.
declare scores as dictionary of text to number
bento run room.bento -- walk into the room
declare n is number
declare n is a number
Unless works the same way as if
but inverts the condition.
If the grammar of a declare is incorrect it will be treated like a normal sentence, which it shouldn't.
Likewise, no sentence is allowed to be defined with the first word as "declare".
Sometimes we want to discard the value when calling, like:
run system command "echo hi" output into _ status code into echo-result
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.