Code Monkey home page Code Monkey logo

lemon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lemon's Issues

Using the return value from snprintf without proper checks can cause overflow.

The size arguments of the following snprintf calls are derived from their return values, which may exceed the size of the buffer and overflow.

The return value of a call to snprintf is the number of characters that would have been written to the buffer assuming there was sufficient space. In the event that the operation reaches the end of the buffer and more than one character is discarded, the return value will be greater than the buffer size. This can cause incorrect behavior.

In line 312 of larray.c:

		length = snprintf(buffer + offset,
		                  maxlen - offset,
		                  fmt,
		                  lstring_to_cstr(lemon, string));

and
In line 357 of ltable.c:

		length = snprintf(buffer + offset,
		                  maxlen - offset,
		                  fmt,
		                  lstring_to_cstr(lemon, key),
		                  lstring_to_cstr(lemon, value));

Uncontrolled process operation

In line 2300 of compiler.c:

handle = dlopen(module_path, RTLD_NOW);

Using externally controlled strings in a process operation can allow an attacker to execute malicious commands.

Building on Windows?

Could this be possible? I've noticed that lemon depends on Linux specific libraries like select.h. Please keep in mind that all of us aren't running on the same OS as you.

Unbounded write by strcpy

In line 2310 of compiler.c:

strcpy(init_name, module_name);

This 'call to strcpy' with input from call to getenv may overflow the destination.

.NET binding

ham2kh

Hello! I would like to say i discovered this language few days ago and instantly became a fan of it because it's easy to embed and not hard to learn.

I wanted to shout out here that i'm making a .NET binding for it because C# is my main language and i'd like to use this from time to time in some projects there.

https://github.com/cartman300/lemonade

The main repository is added as a submodule and compiles in visual studio just fine with some external supporting headers and without modifying the source code. ๐Ÿ‘

Also a side question, would it be possible to add a function similar to lemon_machine_execute and lemon_machine_execute_loop which only steps trough N machine instructions and returns back to the caller? I see this being useful when embedding the language into a video game update loop, it would prevent stuff like while (true) { } from hanging the game.

drop var

the var here adds nothing:
def hello(var name) {

Almost a JS

Looks like Lemon is close to JS so why not to make it as a subset of JS?

How to build on Android using clang?

Termux don't have gcc.The only available c/cpp compiler is clang.
Current Makefile will generate an error that "couldn't find gcc-ar".
Thanks!

Inconsistent null checks

symbol = scope_add_symbol(lemon,

lemon/lib/os.c

Line 369 in b1bb8a6

tmobject = lobject_create(lemon, sizeof(struct ltmobject), ltmobject_method);

symbol = scope_add_symbol(lemon, lemon->l_global, name, SYMBOL_GLOBAL);

frame = machine_peek_frame(lemon);

The functions called in these lines are consistently checked for null except in these instances. The lack of a null check could mask bugs.

A couple of questions

First of all, great job; I love your coding style, it's super clean.

If I may, I would like to ask a couple of questions:

  • What led you, frustrated you, or even motivated you to build a new language?
  • What problems are you trying to solve?
  • Is it GIL-free?
  • Is it thread-safe by default?
  • JIT support please?
  • Any plans for generics support?

That's it for now.

Keep up the good work ๐Ÿ‘

history support

Lemon does not support retrieving the history via arrow keys. Is it possible to implement GNU Readline to support shell-like shortcuts?

lemon-issue

delete this

hey
please delete or rename

i literally built my whole personality around a language called lemon-lang and you are breaking my heart

https://github.com/imagine-hussain/lemonlang

It is based off my best friend luke-fisk-lennon who's brother died of cancer so we want to write a language in his honour :(

pls bro i beg u bro pls i am litarlly crying rn pls change name

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.