1. Lazurite Programming language
1. Axolotol Programming language
Lazurite Programming Language
License: MIT License
I don't think it is a great decision to put evaluation logic into AST classes. Maybe create a separate from ast
package classes for that, for easier process of adding new builtin types into the language?
Also it will be easier, if the language is going to have a VM later. Because the logic for VM bytecode emitting is going to be in different classes.
In com.kingmang.lazurite.lib
i see ..Exeption
class names all around, which isn't actually correct spelling of word Exception
.
- public final class _AExeption extends RuntimeException
+ public final class _AException extends RuntimeException
- public final class _LExeption extends RuntimeException
+ public final class _LException extends RuntimeException
...
Also exception names seem really confusing for me. What is _AExeption
, _LExeption
, _PExeption
, etc.? They should really be renamed.
Functions
, ClassDeclarations
, Classes
are also a bit confusing. In my opinion, it is better to use Storage
, Resolver
or Manager
postfix:
- Functions
+ FunctionManager
- Classes
+ ClassManager
- Functions
+ FunctionStorage
- Classes
+ ClassStorage
- Functions
+ FunctionResolver
- Classes
+ ClassResolver
Take for instance a utility class, related to function arguments:
public final class Arguments {
private Arguments() { }
public static void check(int expected, int got) {
if (got != expected) throw new _AExeption(String.format(
"%d %s expected, got %d", expected, pluralize(expected), got));
}
public static void checkAtLeast(int expected, int got) {
if (got < expected) throw new _AExeption(String.format(
"At least %d %s expected, got %d", expected, pluralize(expected), got));
}
public static void checkOrOr(int expectedOne, int expectedTwo, int got) {
if (expectedOne != got && expectedTwo != got)
throw new _AExeption(String.format(
"%d or %d arguments expected, got %d", expectedOne, expectedTwo, got));
}
public static void checkRange(int from, int to, int got) {
if (from > got || got > to)
throw new _AExeption(String.format(
"From %d to %d arguments expected, got %d", from, to, got));
}
private static String pluralize(int count) {
return (count == 1) ? "argument" : "arguments";
}
}
Maybe use Utilities
, Utils
or Helper
postfix?
- public final class Arguments {
+ public final class ArgumentUtilities {
- public final class Arguments {
+ public final class ArgumentUtils {
- public final class Arguments {
+ public final class ArgumentHelper {
In COUT_Setting
, underscore creates case inconstancy with other names like AbstractVisitor
or Console
:
- public class COUT_Setting implements OutputSettings {
- public class SOUT_Setting implements OutputSettings {
It can also be seen in module names:
- Arrays
+ arrays
- GForms
+ gforms
- HTTP
+ http
java
- LFS
+ lfs
...
SOUT_Setting
can be renamed to something likeStringOutSetting
, I have no idea at the moment.
Going back to the previous code spinnet, COUT_Setting
implements OutputSettings
, which in my opinion creates the plural/singular inconstancy.
It can again be seen in module names:
- Arrays
+ array
- GForms
+ gform
- HTTP
+ http
java
- LFS
+ lfs
...
I guess in the future, we can write our own diagnostics emission library, so that we can get rid of throwing Java exceptions.
Instead of storing executables right in the repository source code, you can just use releases
tab in the GitHub. It also allows you to store executables for different versions of your project. WDYT?
Возможность разделить программу на несколько файлов, чтобы весь код не был в одном файле. Это улучшит организацию и структуру проекта.
Как это будет выглядеть:
main.lzr
using "./myModule"
greet("Hamlet")
myModule.lzr
func greet(name) {
print("Hello " + name + "!")
}
I think commits messages in the repository at the moment aren't great - they are not descriptive and in most cases it's easy to get confused.
I suggest using conventional commits which are a way to standardize commit messages. Here is an example of how they are used in my repository:
As you can see commit messages are more descriptive and now make some kind of sense.
Conventional Commits Standart also applies to the commit's footers and description.
I think using them will make it easy to work asynchronously and resolve merge conflicts, track progress, or just see the project's history.
Here are some resources on the topic:
Conventional Commits Specification.
Conventional Commits: A Better Way.
Another Conventional Commits Article.
Everything I try to run, it says Command not found!
. I have checked and lazurite is in my path. It runs normally without arguments.
OS: Linux Mint 20.3 Una (x86_64)
Shell: bash 5.0.17
Terminal: gnome-terminal
Lazurite version: 2.7.4 (.jar)
My modifications: I moved the jar from ~/Downloads/Lazurite.jar
to /usr/bin/lazurite
.
Пример реализации:
func add(a: int, b: int) int {
return a + b
}
a: int = 4
b: int = 5
result: int = add(a, b)
или
func add(int a, int b) int {
return a + b
}
int a = 4
int b = 5
int result = add(a, b)
Указывать типы вручную не обязательно (как в python)
Добавление типизации поможет программистам, которые делают (или будут делать) утилиты для лазурита
C
Хотелось бы иметь возможность редактировать и запускать код на лазурите с телефона, это даст хороший буст не только к аудитории, у которых не часто есть доступ к пк, но и + компактность. Не обязательно делать какой-то очень крутой редактор, достаточно будет подсветки синтаксиса, запуска и работы с файлами (чтобы их можно было загружать в проект из приложения)
Привет. Простите, я новичок в лазурите, но мне интересно, можно-ли использовать http запросы в нем?
Я видел примеры с парсингом страниц, но обычный http пока-что нет
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.