Skip to main content

How to install and code in Linea 2?

 Understanding the architecture of Linea 2

The Linea 2 has updated and revamped codebase, the old Linea 1.x was a single file interpreter, however the problem was that because it was single-file interpreter, it was large (around 75 MB), which took a lot of time to load, so I thought to split the core functions of Linea to a library/module called `liblinea`. Initially in Linea 2 v2.0, the library was only limited to basic core functionalities, however in it's second update, v2.1.0, I added two more sub-libraries, `liblinea_math` and `liblinea_weblet` (initially, `liblinea.math` and `liblinea.weblet`). The separation of main interpreter and it's standard library improved loading time by 7 seconds (1.x took around 16 seconds to load, while 2.x takes 9 seconds approx.*). I'm trying hard to make it even more faster to load.

Architecture in Linea 1.x


Linea (Interpreter with libraries linked) + Source Code (<file>.ln) --> 16 seconds (Load) + Output

Architecture in Linea 2.x


Linea (Interpreter) + LibLinea (Standard Library) + Source Code (<file>.ln) --> 9 seconds (Load) + Output + (Optional) Weblet + Math --> 2 seconds (Load) + Output


Downloading and Installing Linea 2

There are 2 options (3 technically) on which format you need Linea in:
  1. Source Code (Clone or download from GitHub repo)
  2. Binaries (Compiled standalone .exe and a compiled .exe with core library in Installer)

Source Code

⚠️ I recommend you to have latest version of Python installed.

If you choose to use it directly from source code, you can clone or download the Linea repository from GitHub, then open the `linea.py` file and install the required dependencies through pip. 
After downloading and installing all necessary libraries, you're good to go.!

Binaries (Windows Only)


⚠️ Binary releases (standalone (portable) and installer) have some issues with 3rd party libraries, as it's not compiled with the source itself.

Download the latest Linea Installer from GitHub, then run the installer and install it in your desired location.
After installation you'll find `linea.exe`, you're good to go, next part tells you how to run your Linea code.


Running your Linea Code


⚠️ Guide and syntax for Linea 2 can be found in `prog.ln` file in the GitHub repo and also in Linea website.

Running your Linea code is easy, just run the script or executable with name of the source file as argument as mentioned below:

If running from source code

On Linux

python3 linea.py <sourceCode>

On Windows


python linea.py <sourceCode>

Binary (Windows Only)

Through Comand Prompt (CMD)

linea <sourceCode>

Through Powershell (PS)

./linea <sourceCode>


Hurray! you just ran a Linea 2 code..!!

Comments

Popular posts from this blog

Windows Neptune: The Unreleased Vision of Microsoft's Future

 In the late 1990s, Microsoft embarked on an ambitious project to revolutionize its operating systems. Codenamed Neptune , this project aimed to create a consumer-oriented version of Windows based on the Windows NT codebase. Although it never saw an official release, Neptune played a crucial role in shaping the future of Windows. The Genesis of Neptune Neptune was conceived as a successor to Windows 98 and Windows Me. The goal was to merge the stability and advanced features of Windows NT with a user-friendly interface suitable for home users. The project began in 1999 and was led by a dedicated team within Microsoft. Key Features and Innovations Neptune introduced several groundbreaking features that were ahead of their time: Activity Centers : One of the most notable innovations was the introduction of Activity Centers. These task-based user interfaces focused on daily activities such as browsing the internet, communication, document management, and entertainment. The idea was to...

DeepSeek : The New Contender in AI

 The AI landscape is buzzing with excitement over the latest innovation from China-based startup DeepSeek. Their new AI model, DeepSeek-R1 , has taken the tech world by storm, challenging established giants like OpenAI. Here's what makes DeepSeek-R1 so special: Unmatched Performance at a Fraction of the Cost DeepSeek-R1 has demonstrated remarkable performance on various benchmarking tools, often rivaling or even surpassing OpenAI's flagship o1 model. What's more impressive is that DeepSeek-R1 achieves this at a fraction of the cost. While OpenAI's o1 model costs $15 per million tokens, DeepSeek-R1's API input cost is just $0.55 per million tokens. Versatility Across Multiple Domains DeepSeek-R1 excels in multiple domains, including language understanding, coding, math, and Chinese language processing. It scored 90.8 on the Massive Multitask Language Understanding (MMLU) benchmark, compared to OpenAI's o1 model which scored 92.3. In coding benchmarks, DeepSeek-R1...

Developing a simple Linux Distro from scratch using Busybox

Greetings, and welcome to my blog. Today, I will discuss how to create a simple Linux distribution using BusyBox . This can be done on any system, whether it is Windows, macOS, or Linux. For Windows, you need WSL, a Docker (Ubuntu) container, or a VM with a Linux distribution installed (Ubuntu or its derivatives are recommended). First, install the prerequisites: Note : If you are using a container, ensure you run it in privileged mode. Bash sudo apt install bc cpio bison libssl-dev libncurses-dev libelf-dev bzip2 make sudo apt install automake autoconf git syslinux dosfstools xz-utils build-essential gcc wget Once you have these dependencies installed, start by creating a directory named distro : Bash sudo mkdir /distro cd /distro After creating and changing the directory, obtain the Linux Kernel, either from git or wget: Note : If you use git, you might clone the beta or release candidate version of the kernel. Bash sudo git clone --depth 1 https://github.com/torvalds/linux OR...