andrefpoliveira / pansy Goto Github PK
View Code? Open in Web Editor NEWMy own programming language
License: MIT License
My own programming language
License: MIT License
Hey ๐
When trying my programming language you are more than welcome to submit your code files here on the folder examples
so others can check it out!
Please make sure you follow the structure of the rest of the other texts because I have a CI support that will verify everything is ok ๐
Don't forget to update the README.md aswell!
Thanks and have fun!
It would be great if we shift the README.md to readthedocs, it will be really nice for new contributors as they can make the offline copy for themselves
labels can be added like:- Hacktoberfest
P.S.- I'm working on this ๐
Hey ๐!
Pansy is such a beautiful flower ๐ and in my country it is known as Amor Perfeito ( Perfect Love in english )
Well basically, I would like to get a logo for my programming language!
Surprise me ๐!!
Description
Not able to use if conditions: gives an error
Traceback (most recent call last):
File <stdin>, line 1, in <program>
File <stdin>, line 1, in run
Runtime Error: Failed to finish executing script "bug.pansy"
Traceback (most recent call last):
File bug.pansy, line 2, in <program>
Runtime Error: Illegal operation
if food == "pizza":
^^^^^^^^^^^^^^^^
print("Yammi!")
^^^^^^^^^^^^^^^^^
end
^^^
run("bug.pansy")
I am on Windows
To Reproduce The Error
Steps to reproduce the behavior:
python shell.pansy
run("bug.pansy")
in the shell (I have created a file called bug.pansy for this issue)var food = "pizza"
if food == "pizza":
print("Yammi!")
end
This was an example in the documentation.
Note:
If you write
var n = 10
if n == 10:
print("n = 10")
end
This works. It is a problem with checking strings.
Expected behavior
Expected to print Yammi! Instead printed illegal operation error
I am on Windows x64 Intel.
Classes in Pansy?
I would like to group all my functions into a class. Is it possible here? I don't remember seeing it in the docs.
Classes
If I have hundreds of functions, I'd like to group all the related ones together. Or, if I want to create a blueprint of a person, I'd want to put methods for things a person would do, like walk, run, and so on inside the class Person, and not have functions all over the place. I think classes are necessary for any programming language.
Hey! Currently Pansy doesn't have a lot of built-in functions. That's were you come in!
If you want to work on any of these please say so, like this no one is working on each other functions.
To insert a new function you need to go to lib/interpreter.py
. You can search for def execute_print
and you will find below all the built-in functions created so far. You can use those as examples!
Then you search for BuiltInFunction.print
and you will get 2 results! Follow those examples to add your function.
Below is a list of the current built-in functions, some ideas and who is working on them:
print
input
is_number
is_string
is_list
is_function
append
pop
set
extend
get
run
len
to_str
to_int
to_float
imports
abs
has_key
min
(between 2 numbers) @DaffyTheDuckmax
(between 2 numbers) @DaffyTheDuckslice
split
oct
@DaffyTheDuckfact
@ZaidtechIf you have any other idea feel free to share it down in the comments so it can be added to the list.
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.