Git Product home page Git Product logo

pansy's Issues

Add examples

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!

Shift the docs to readthedocs

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 ๐Ÿ˜„

Logo Needed

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 ๐Ÿ˜ƒ!!

[BUG] Not able to use if conditions!

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:

  1. Start Pansy with the command python shell.pansy
  2. Execute the code run("bug.pansy") in the shell (I have created a file called bug.pansy for this issue)
Bug.pansy:

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

Screenshots
image

image

image

image

I am on Windows x64 Intel.

[ENH] Classes in Pansy?

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.

Add new Built-in Functions

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.

How to add new 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.

List

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) @DaffyTheDuck
  • max (between 2 numbers) @DaffyTheDuck
  • slice
  • split
  • oct @DaffyTheDuck
  • fact @Zaidtech

If you have any other idea feel free to share it down in the comments so it can be added to the list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.