- 📫 How to reach me: Discord(Calamity#8470)
calamity210 / birblang Goto Github PK
View Code? Open in Web Editor NEWMinimal Bird programming language curated to help new contributers delve into OSS
Minimal Bird programming language curated to help new contributers delve into OSS
List<String> = ["a", "b", "c"];
type example = List<String>;
Describe the bug
Cant access List
s or Map
s from within a class directly
To Reproduce
Steps to reproduce the behavior:
birb
commandclass Foo {
List list = ["value"];
}
screm(Foo.list[0]);
runBirb
commandExpected behavior
Expected to print value
.
Additional context
The scope gets messed up and the program tries to find a list within the global scope.
Describe the bug
Running a program without semi colons would generally run the first line correctly, but ignore all other lines rather than throwing an error
To Reproduce
screm(0)
screm(1);
Notice how only 0
is scremed
Expected behavior
Expect an error to be thrown stating that a semi-colon is expected
Add enums with super powers!
enum {
a = "Hello",
b = "Allo",
c = "Bonjour",
} example;
enum {
a = 0,
b = 500,
c = 600,
} example;
enum {
String(String),
Bool(bool),
} example;
Describe the bug
The parser currently expects any occurrence of a data type to lead to a function/variable definition. This causes us to not be able to add type specific classes.
Example
We should be able to add a function for strings such as String.fromCharCode()
, but calling this would throw an UnexpectedTokenException as it is expecting an identifier (the name of a variable)
To Reproduce
N/A
Errors always point to line 1
To Reproduce
Steps to reproduce the behavior:
birb
commandString bar = "hello";
int I = 0;
screm(foo);
runBirb()
commandExpected behavior
An error pointing to line 3 stating that the variable foo
does not exit
Our documentation currently contains only a tour, String
, Map
, and Int
. We need to:
bool
, or double
, as well as standard methods(grab, etc...) or libraries (math, io, etc...).Once we've caught up the docs, I plan on enforcing documenting (where possible) changes made in a PR.
Describe the solution you'd like
Add methods and parameters for maps
Describe the solution you'd like
We need a better testing framework. A way so we can test expected outputs and errors from birb code. Something like
screm("Hello World") // expect: Hello World
and then the test would parse the comment to get what's expected. This is not to be confused with a testing framework for birb itself, this is solely to test this repo
Describe the solution you'd like
Add constructor() methods in classes. Mainly add arguments support in classes.
Additional context
N/A
Describe the bug
Chaining operations results in an error. As an example, for "foo".length.isEven
. The attribute access is handled as "foo.(length.isEven)"
rather than (foo.length).isEven
To Reproduce
Steps to reproduce the behavior:
birb
commandString str = "Foo";
bool isEven = str.length.isEven;
Expected behavior
Expect bool isEven
to be false
Unhandled exception:
UndefinedVariableException: Error: [Line 2] Undefined variable `length`.
#0 visitVariable (package:Birb/runtime/runtime.dart:407:3)
<asynchronous suspension>
#1 visit (package:Birb/runtime/runtime.dart:211:20)
#2 visitAttAccess (package:Birb/runtime/runtime.dart:900:22)
#3 visit (package:Birb/runtime/runtime.dart:267:20)
#4 visitAttAccess (package:Birb/runtime/runtime.dart:1011:24)
<asynchronous suspension>
#5 visit (package:Birb/runtime/runtime.dart:267:20)
#6 visitVarDef (package:Birb/runtime/runtime.dart:438:34)
#7 visit (package:Birb/runtime/runtime.dart:213:20)
#8 visitCompound (package:Birb/runtime/runtime.dart:866:25)
<asynchronous suspension>
#9 visit (package:Birb/runtime/runtime.dart:241:20)
#10 main (package:Birb/birb.dart:93:9)
#11 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Process finished with exit code 255
Performing operations on function parameters causes the program to get stuck within an infinite loop
Steps to reproduce the behavior:
birb
commandvoid addAndPrint(int a, int b) {
screm(a+b);
}
addAndPrint(5, 7);
runBirb()
commandThe program should be printing 12
Starts the loop within visitFuncCall (runtime.dart)
Add use:
Syntax
use library.someClass.someFunction;
use library.someFunction;
use library.someVariable;
// Multiple use’s
use library.{someClass, someVar, someFunc};
Update grab to not pollute:
grab("somelib");
// To access the function
somelib.someFunc();
This is tbh p easy so this can be marked as a good first issue! :)
Some methods for Strings are still a work in progress in https://gc.spidev.codes/docs/birb/core/String.html
Describe the bug
In birb:ui
when I move the mouse a bit fast or is off the screen and comes back again then I get this exception:
Unhandled exception:
Concurrent modification during iteration: Instance of 'ListQueue<ASTNode>'.
#0 ListQueue._checkModification (dart:collection/queue.dart:800:7)
#1 _ListQueueIterator.moveNext (dart:collection/queue.dart:910:12)
#2 collectAndSweepGarbage (package:Birb/runtime/runtime.dart:109:38)
#3 visitCompound (package:Birb/runtime/runtime.dart:948:3)
Full Logs:
PS C:\Users\user\Desktop\Andy\Projects\Birb\BirbLang> dart .\lib\birb.dart .\examples\ui.birb
lib/birb.dart: Warning: Interpreting this as package URI, 'package:Birb/birb.dart'.
1 : 26725049000
0 : 26725048952
0 : 26725048952
0 : 26725048952
0 : 26725048952
1 : 26725049000
0 : 26725048856
0 : 26725048856
0 : 26725048856
0 : 26725048856
0 : 26725048856
0 : 26725048856
0 : 26725048776
0 : 26725048776
Unhandled exception:
Concurrent modification during iteration: Instance of 'ListQueue<ASTNode>'.
#0 ListQueue._checkModification (dart:collection/queue.dart:800:7)
#1 _ListQueueIterator.moveNext (dart:collection/queue.dart:910:12)
#2 collectAndSweepGarbage (package:Birb/runtime/runtime.dart:109:38)
#3 visitCompound (package:Birb/runtime/runtime.dart:948:3)
<asynchronous suspension>
#4 visit (package:Birb/runtime/runtime.dart:282:20)
<asynchronous suspension>
#5 runtimeFunctionCall (package:Birb/runtime/runtime.dart:192:16)
<asynchronous suspension>
#6 runtimeFuncLookup (package:Birb/runtime/runtime.dart:834:18)
<asynchronous suspension>
#7 visitFuncCall (package:Birb/runtime/runtime.dart:905:36)
#8 mouseCallback (package:Birb/external/ui.dart:33:3)
#9 _FfiCallbackmouseCallback (dart:ffi)
#10 FfiTrampoline (dart:ffi)
#11 windowClass.<anonymous closure> (package:Birb/external/ui.dart:99:19)
#12 visitAttAccess (package:Birb/runtime/runtime.dart:1091:67)
<asynchronous suspension>
#13 visit (package:Birb/runtime/runtime.dart:323:20)
<asynchronous suspension>
#14 visitCompound (package:Birb/runtime/runtime.dart:932:35)
<asynchronous suspension>
#15 visit (package:Birb/runtime/runtime.dart:282:20)
<asynchronous suspension>
#16 visitWhile (package:Birb/runtime/runtime.dart:2120:27)
<asynchronous suspension>
#17 visit (package:Birb/runtime/runtime.dart:317:20)
#18 visitCompound (package:Birb/runtime/runtime.dart:932:35)
<asynchronous suspension>
#19 visit (package:Birb/runtime/runtime.dart:282:20)
#20 main (package:Birb/birb.dart:97:11)
#21 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#22 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)```
Currently, our examples are simply contain multiple scremLn
s, (nearly) all of them need to be change to show a more realistic use case.
Describe the bug
Reassigning a variable causes a null exception to be thrown.
Unhandled exception:
NoSuchMethodError: The getter 'type' was called on null.
Receiver: null
Tried calling: type
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 visitVarAssignment (package:Birb/utils/runtime.dart:504:17)
<asynchronous suspension>
#2 visit (package:Birb/utils/runtime.dart:219:20)
#3 visitCompound (package:Birb/utils/runtime.dart:869:25)
<asynchronous suspension>
#4 visit (package:Birb/utils/runtime.dart:245:20)
#5 main (package:Birb/birb.dart:43:15)
#6 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
To Reproduce
Steps to reproduce the behavior:
birb
commandvar x = 1;
x = 2;
runBirb
commandExpected behavior
Expected no error to be thrown
Describe the bug
if, for, while to name a few take a body statement. In general, this is either a single statement or a compound statement.
Statements that take a single statement body expect their outer compound statement to end If they are nested inside a compound statement, ie, they expect a RBRACE ('}') token after the single statement
if (true) {
if (true)
screm('true is true');
//v--- The parser throws unexpected token error
screm('just testing');
}
If they aren't nested they run, but the program ends after the single statement.
if (true)
screm('true is true');
// program ends here
screm('just testing');
To Reproduce
Steps to reproduce the behavior:
Actual Results
The first program throws the following error:
UnexpectedTokenException: [Line 4] Unexpected token `screm`, was expecting `TokenType.TOKEN_RBRACE`
The second program outputs the following:
true is true
Expected Behaviour
Expected the first program to run without errors and the second program to not end after the single statement body. Also both programs should output:
true is true
just testing
Add abstract classes as well as the ability to implement and extend classes
This is a very important thing that a language should have. Even though if its inbuilt std lib is not good then its P easy to use ffi and make a amazing library and add it to github and include it in your project using nest.
Describe the bug
break
and continue
don't work if they are not direct children of the for loop body AST
To Reproduce
Steps to reproduce the behavior:
1- Run the following birb program
for (int j = 0; j < 5; j++) {
if (j == 2) {
break;
}
screm(j);
}
for (int k = 0; k < 5; k++) {
if (k == 3) {
continue;
}
screm(k);
}
Actual Results
first loop outputs 0 1 2 3 4
second loop outputs 0 1 2 3 4
Expected behavior
The first loop should output 0 1
The second loop should output 0 1 2 4
Additional context
The way this should be handled is by throwing an exception in visitBreak
and visitContinue
. The exception should be caught and handled by the loops (for and while). These exceptions aren't an indication of an error, but rather used as a flow control to unwind the call stack to the loops handling functions.
Describe the bug
We cannot use grab in windows. This is just because we are not doing path.join()
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.