GitHub - VxidDev/Arc: A simple, interpreted programming language written in C. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
VxidDev
Arc
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>75 Commits<br>75 Commits
docs
docs
include
include
src
src
.gitignore
.gitignore
LICENSE
LICENSE
README.md
README.md
makefile
makefile
math.arc
math.arc
View all files
Repository files navigation
Arc
Arc is a small programming language project written in C. It focuses on building a clean and reliable frontend pipeline, along with a simple interpreter for evaluating expressions and basic variable assignments.
Documentation
For detailed information, please refer to the documentation in the docs/ folder:
Getting Started
Language Reference
Architecture
Project Structure
├── docs<br>│ ├── architecture.md<br>│ ├── getting-started.md<br>│ ├── index.md<br>│ └── syntax.md<br>├── include<br>│ ├── ansi-colors.h<br>│ ├── builtIns<br>│ │ ├── errors.h<br>│ │ ├── io.h<br>│ │ ├── lists.h<br>│ │ ├── math.h<br>│ │ ├── properties.h<br>│ │ ├── string.h<br>│ │ └── typing.h<br>│ ├── builtIns.h<br>│ ├── error.h<br>│ ├── interpretator.h<br>│ ├── lexer.h<br>│ ├── mempool.h<br>│ ├── node.h<br>│ ├── object.h<br>│ ├── parser.h<br>│ ├── position.h<br>│ ├── repl<br>│ │ ├── help.h<br>│ │ ├── input.h<br>│ │ ├── printast.h<br>│ │ ├── readfile.h<br>│ │ └── repl.h<br>│ ├── symbol-table.h<br>│ ├── token.h<br>│ └── utils.h<br>├── LICENSE<br>├── makefile<br>├── math.arc<br>├── README.md<br>└── src<br>├── builtIns<br>│ ├── errors.c<br>│ ├── io.c<br>│ ├── lists.c<br>│ ├── math.c<br>│ ├── properties.c<br>│ ├── string.c<br>│ └── typing.c<br>├── builtIns.c<br>├── error.c<br>├── interpretator.c<br>├── lexer.c<br>├── mempool.c<br>├── node.c<br>├── object.c<br>├── objects<br>│ ├── break.c<br>│ ├── continue.c<br>│ ├── error.c<br>│ ├── file.c<br>│ ├── function.c<br>│ ├── list.c<br>│ ├── module.c<br>│ ├── number.c<br>│ ├── return.c<br>│ └── string.c<br>├── parser.c<br>├── position.c<br>├── repl<br>│ ├── help.c<br>│ ├── input.c<br>│ ├── main.c<br>│ ├── printast.c<br>│ ├── readfile.c<br>│ └── repl.c<br>├── symbol-table.c<br>├── token.c<br>└── utils.c
Features
Arc is a C-based programming language with a focus on a clean frontend pipeline and a simple interpreter. Key implemented features include:
Variables and Assignment: Declare and update variables using the VAR keyword.
Functions: Define custom functions with parameters and return values using the FN and RETURN keywords.
Built-in Functions: Support for built-in functions implemented in C for core functionalities like I/O, type checking, list manipulation, and error handling.
Control Flow:
Conditional Statements: IF, THEN, ELIF, ELSE for branching logic.
Loops: WHILE and FOR loops for repetitive execution.
Loop Control: BREAK and CONTINUE statements.
Exception Handling: TRY...CATCH blocks for handling runtime errors.
Data Types: Supports numbers (integers and floats), strings, booleans, and lists.
Import System: Modularize code using the IMPORT keyword.
Memory Management: Uses custom memory pools for efficient object allocation.
Error Handling: Robust error reporting with position tracking (file, line, column).
REPL: Interactive environment with syntax highlighting (via ANSI colors) and command-line options.
Example
File Execution
Create a file named script.arc:
VAR list = [1, 2, 3, 4, 5]
FOR item IN list THEN<br>IF item == 3 THEN<br>CONTINUE<br>END<br>print("Item: ", item)<br>END
Running this file (./arc script.arc) will output:
Item: 1<br>Item: 2<br>Item: 4<br>Item: 5
Roadmap
Proper re-declaring and type-check
Better standard library
Scoped environments (currently variables are re-declared in same scope)
Bytecode virtual machine (long-term goal)
License
GPL-3.0
About
A simple, interpreted programming language written in C.
Topics
programming-language
performance
interpreter
Resources
Readme
License
GPL-3.0 license
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
stars
Watchers
watching
Forks
fork
Report...