### Install and Serve Frontend Project Source: https://github.com/abneeshsingh21/epl/blob/main/frontend-starter/README.md Use these commands to install project dependencies and start the development server. ```bash cd frontend-starter epl install epl serve ``` -------------------------------- ### Install and Serve MkDocs Material Source: https://github.com/abneeshsingh21/epl/blob/main/CONTRIBUTING.md Install the necessary package and start a local server to preview documentation changes built with MkDocs Material. ```bash pip install mkdocs-material mkdocs serve ``` -------------------------------- ### Install and Run EPL Source: https://github.com/abneeshsingh21/epl/blob/main/examples/README.md Installs the EPL package and runs a basic example file. ```bash pip install eplang epl run examples/hello.epl ``` -------------------------------- ### Web Application Setup in EPL Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Shows the minimal keywords required to set up a web server in EPL: 'Create webapp', 'Route', and 'Start on port'. ```EPL Create webapp Route Start on port ``` -------------------------------- ### Starting an EPL Web Server Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Demonstrates how to create, configure, and start an EPL web server, including defining basic GET routes for a homepage and a JSON status endpoint. ```APIDOC ## Starting an EPL Web Server ### Description This snippet shows how to initialize a web server, set its port, define a GET route for the homepage, and a GET route that returns JSON. ### Methods - `web_server_create()` - `web_server_set_port(server, port)` - `web_server_route(server, method, path, handler)` - `web_server_start(server)` ### Example ```epl server = web_server_create() web_server_set_port(server, 8080) web_server_route(server, "GET", "/", lambda req: web_response(200, "text/html", "

Welcome to EPL Web!

") ) web_server_route(server, "GET", "/api/status", lambda req: web_response(200, "application/json", "{\"status\": \"ok\", \"version\": \"1.0\"End") ) Say "Server running at http://localhost:8080" web_server_start(server) ``` ``` -------------------------------- ### Basic EPL Web Application Setup Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-web/README.md This snippet demonstrates how to set up a basic web application using the epl-web facade. It includes creating an app instance, defining routes for HTML and JSON responses, and starting the application server. ```epl use "epl-web" Create app equal to create_app("demo") Call get_route(app, "/", given req return html_response("

Hello from EPL Web

", 200)) Call get_route(app, "/api/health", given req return json_response(Map with status = "ok", 200)) Call start_app(app, 8080) ``` -------------------------------- ### Verify EPL Development Setup Source: https://github.com/abneeshsingh21/epl/blob/main/CONTRIBUTING.md Runs a specific test file to verify the framework setup and checks the installed EPL version. Use this after installing the development dependencies. ```bash python -m pytest tests/test_framework.py -q epl --version ``` -------------------------------- ### EPL Collections Quick Start Example Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-collections/README.md Demonstrates basic usage of Stack and Graph data structures with shortest path calculation. Ensure 'epl-collections' is imported before use. ```epl Import "epl-collections" Note: Stack Set stack to create_stack() stack_push(stack, "hello") Say stack_pop(stack) Note: Graph with shortest path Set g to create_graph(False) graph_add_edge(g, "A", "B", 5) graph_add_edge(g, "B", "C", 3) graph_add_edge(g, "A", "C", 10) Say graph_shortest_path(g, "A", "C") ``` -------------------------------- ### Setup and Development Environment for EPL Source: https://github.com/abneeshsingh21/epl/blob/main/README.md Clone the repository, navigate to the directory, install development dependencies including cloud support, format code with Ruff, and run tests using pytest. ```bash git clone https://github.com/abneeshsingh21/EPL.git cd EPL pip install -e ".[dev,cloud]" ruff format . pytest tests/ -x --tb=short -q ``` -------------------------------- ### Install EPL Language Source: https://github.com/abneeshsingh21/epl/blob/main/docs/index.html Use pip to install the EPL language package. This is the initial setup step for using EPL. ```bash $ pip install eplang ``` -------------------------------- ### Install and Package with EPL Source: https://github.com/abneeshsingh21/epl/blob/main/packages/reference-hello-lib/README.md Use 'epl install' to install the library and 'epl package' to package an EPL file. ```bash epl install epl package src/main.epl ``` -------------------------------- ### Run Any Example Source: https://github.com/abneeshsingh21/epl/blob/main/examples/README.md General command to execute any EPL example file by specifying its filename. ```bash epl run examples/.epl ``` -------------------------------- ### Install and Serve Auth Starter Project Source: https://github.com/abneeshsingh21/epl/blob/main/auth-starter/README.md Commands to install dependencies and serve the auth-starter project locally. ```bash cd auth-starter epl install epl serve ``` -------------------------------- ### EPL Application Entry Point: main.epl Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html This is an example of a main EPL file for a web application, demonstrating how to import various modules for configuration, database interaction, and routing, and then start the web server. ```epl Import "config.epl" Import "db/connection.epl" as db Import "db/migrations.epl" Import "routes/todos.epl" Import "routes/auth.epl" conn = db.connect(DB_PATH) run_migrations(conn) server = web_server_create() web_server_set_port(server, SERVER_PORT) register_todo_routes(server, conn) register_auth_routes(server, conn) Say "App running on port $SERVER_PORT" web_server_start(server) ``` -------------------------------- ### EPL Science Package Quick Start Examples Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-science/README.md Demonstrates basic usage of optimization, integration, and statistical testing functions within the EPL Science Package. Requires 'epl-science' to be used. ```epl Use "epl-science" -- Optimization: Find minimum of x² + 2x + 1 Define my_func Takes x Return x[0] * x[0] + 2 * x[0] + 1 End Set result to minimize_function(my_func, [0], "BFGS") Say "Minimum at: " + result["x"] -- Integration Define f Takes x Return x * x End Set integral to integrate(f, 0, 1) Say "Integral of x² from 0 to 1: " + integral["value"] -- Statistical test Set group_a to [23, 25, 28, 24, 26] Set group_b to [30, 32, 29, 31, 33] Set test_result to t_test(group_a, group_b) Say "T-test p-value: " + test_result["pvalue"] ``` -------------------------------- ### Quick Start HTTP GET Request Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-http/README.md Demonstrates a basic HTTP GET request to fetch user data and process the JSON response. Ensure the response is checked for success before parsing. ```epl Import "epl-http" Set response to http_get("https://api.example.com/users") If response_is_ok(response) then Set users to response_json(response) Say "Found " + length(users) + " users" End ``` -------------------------------- ### EPL DataFrame Quick Start Example Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-dataframe/README.md Demonstrates creating a DataFrame, performing basic operations like filtering and grouping, and saving results using the EPL DataFrame package. ```epl Use "epl-dataframe" -- Create a DataFrame Set data to {"name": ["Alice", "Bob", "Charlie"], "age": [25, 30, 35], "city": ["NYC", "LA", "NYC"]} Set df to create_dataframe(data) -- Basic operations Say "Columns: " + columns_of(df) Say "Rows: " + rows_of(df) -- Filter data Set adults to filter_where(df, "age", ">=", 30) Say "Adults: " + print_dataframe(adults) -- Group and aggregate Set by_city to group_and_count(df, "city") Say "Count by city: " + print_dataframe(by_city) -- Save results save_to_csv(df, "output.csv") ``` -------------------------------- ### Database Application with Table Creation and Insertion Source: https://github.com/abneeshsingh21/epl/blob/main/README.md Build database applications using the 'epl-db' module. This example shows how to open a database, create a 'tasks' table, and insert a new task. Ensure the 'epl-db' module is installed. ```epl Import "epl-db" db = open("app.db") create_table(db, "tasks", Map with title = "TEXT" and done = "INT") insert(db, "tasks", Map with title = "Ship EPL" and done = 0) ``` -------------------------------- ### Start Server Source: https://github.com/abneeshsingh21/epl/blob/main/llms-full.txt Starts the web application server. ```APIDOC ## Start Server ### Description Starts the web application server. The default bind host is 127.0.0.1 (localhost). Binding to 0.0.0.0 may print a warning. Environment variables `PORT`, `EPL_WEB_PORT`, or `EPL_WEB_HOST` can override runtime settings. ### Syntax ```epl Start on port ``` ### Example ```epl Start myApp on port 8080 ``` ``` -------------------------------- ### Install All EPL Dependencies Source: https://github.com/abneeshsingh21/epl/blob/main/docs/package-manager.md Installs all dependencies listed in `epl.toml` or `epl.json`. Use `--frozen` for lockfile-only installation. ```bash epl install epl install --frozen ``` -------------------------------- ### Install epl-web Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-web/README.md Use this command to install the epl-web package. ```bash epl use epl-web ``` -------------------------------- ### EPL Discord Agent Bot Startup Output Source: https://github.com/abneeshsingh21/epl/blob/main/examples/discord_agent/README.md Example output shown when the EPL Discord Agent bot successfully starts. It confirms the loading of environment variables, database readiness, and successful connection to the Discord Gateway. ```text ╔══════════════════════════════════════════════╗ ║ EPLAI Discord Agent v1.0 ║ ║ Built 100% in EPL — English Prog. Language ║ ╚══════════════════════════════════════════════╝ ✅ DISCORD_TOKEN loaded. ✅ GROQ_API_KEY loaded. [Memory] ✅ Database ready. [Bot] Connecting to Discord Gateway using EPL native WebSocket... [Gateway] ✅ Bot logged in as: EPLAI#1234 ``` -------------------------------- ### Create Database Migrations Source: https://github.com/abneeshsingh21/epl/blob/main/docs/guides/database.md Define migration logic within functions to ensure they can be executed during application startup and test setup. This example creates a 'users' table and an index on the 'email' column if they do not already exist. ```epl Function migrate takes db db_execute(db, "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, email TEXT NOT NULL UNIQUE, password_hash TEXT NOT NULL)") db_execute(db, "CREATE INDEX IF NOT EXISTS idx_users_email ON users(email)") End db = db_open("auth.db") migrate(db) ``` -------------------------------- ### Install and Serve EPL API Source: https://github.com/abneeshsingh21/epl/blob/main/apps/reference-backend-api/README.md Use these commands to install the EPL dependencies and serve the reference backend API from a specified source file on a given port. ```bash epl install ``` ```bash epl serve src/main.epl --port 8000 ``` -------------------------------- ### List Local Examples Directory Source: https://github.com/abneeshsingh21/epl/blob/main/docs/examples.md Lists the contents of the local examples directory, including various application subdirectories. ```bash examples/ apps/reference-backend-api/ apps/reference-fullstack-web/ apps/reference-android/ ``` -------------------------------- ### Start EPL Web Server Source: https://github.com/abneeshsingh21/epl/blob/main/docs/tutorials/01_epl_website.md Start the EPL web server on a specified port using the `Start` keyword. ```epl Start mySite on port 8080 ``` -------------------------------- ### Install EPL with AI Tooling Source: https://github.com/abneeshsingh21/epl/blob/main/docs/support-matrix.md Install EPL with AI tooling support. ```bash pip install "eplang[ai]" ``` -------------------------------- ### Install, Serve, and Test Chatbot Source: https://github.com/abneeshsingh21/epl/blob/main/chatbot-starter/README.md Commands to install dependencies, serve the chatbot application, and run tests. ```bash cd chatbot-starter epl install epl serve epl test tests/ ``` -------------------------------- ### Install epl-test Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-test/README.md Use this command to install the epl-test package. ```bash epl use epl-test ``` -------------------------------- ### Install epl-auth Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-auth/README.md Use the epl install command to add the epl-auth package to your project. ```bash epl install epl-auth ``` -------------------------------- ### Install EPL Learn Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-learn/README.md Use this command to install the epl-learn package within your EPL environment. ```bash epl use epl-learn ``` -------------------------------- ### Install EPL with Redis Support Source: https://github.com/abneeshsingh21/epl/blob/main/docs/support-matrix.md Install EPL with Redis-backed features enabled. ```bash pip install "eplang[redis]" ``` -------------------------------- ### Install epl-http Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-http/README.md Use this command to install the epl-http package. ```bash epl install epl-http ``` -------------------------------- ### Install and Package VS Code Extension Source: https://github.com/abneeshsingh21/epl/blob/main/vscode-extension/README.md Steps to install dependencies and package the VS Code extension into a .vsix file for installation. ```bash cd vscode-extension npm install npx @vscode/vsce package ``` -------------------------------- ### Initialize Pyodide and EPL Runtime Source: https://github.com/abneeshsingh21/epl/blob/main/docs/playground.html Asynchronously initializes Pyodide, installs necessary packages (micropip, sqlite3, ssl), and then installs the EPL language runtime from PyPI. Updates the UI to indicate readiness. ```javascript let pyodideReady = false; let pyodide = null; async function initEngine() { try { // 1. Load Pyodide pyodide = await loadPyodide(); // 2. Install required Pyodide packages await pyodide.loadPackage("micropip"); await pyodide.loadPackage("sqlite3"); await pyodide.loadPackage("ssl"); const micropip = pyodide.pyimport("micropip"); printToTerminal("> Installing eplang from PyPI...", "system"); // 3. Install EPL from PyPI await micropip.install("eplang"); printToTerminal("> Kernel Initialized. System Ready.", "success"); printToTerminal("--------------------------------------------------\n"); document.getElementById('status-text').innerHTML = ' Runtime Online'; document.getElementById('run-btn').disabled = false; pyodideReady = true; // Run initial AST analysis on the default editor content analyzeCodeAST(editor.getValue()); // Load shared code from URL hash if present loadFromHash(); } catch (err) { printToTerminal(`> KERNEL PANIC: ${err}`, "error"); document.getElementById('status-text').innerHTML = ' System Offline'; } } ``` -------------------------------- ### Web Server: Start Server Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Starts the HTTP server `s` listening for incoming connections. This function blocks execution. ```epl web_server_start(s) ``` -------------------------------- ### Install and Serve EPL Application Source: https://github.com/abneeshsingh21/epl/blob/main/apps/reference-fullstack-web/README.md Installs dependencies and serves the EPL application with SQLite backend and session management. Use this to run the application locally. ```bash epl install epl serve src/main.epl --port 8000 --store sqlite --session sqlite ``` -------------------------------- ### Serve Starter Project Source: https://github.com/abneeshsingh21/epl/blob/main/examples/README.md Runs a full-stack TODO app using the EPL development server. ```bash epl serve examples/todo_app/main.epl ``` -------------------------------- ### Install EPL Server Package Source: https://github.com/abneeshsingh21/epl/blob/main/README.md Install the necessary package for production deployment and serving EPL applications. ```bash pip install "eplang[server]" ``` -------------------------------- ### Start Web Server Source: https://github.com/abneeshsingh21/epl/blob/main/docs/llms-full.txt Starts the web application server on a specified port. ```APIDOC ## Start Web Server ```epl Start myApp on port 8080 ``` **Description:** This command starts the web server for the application instance named `myApp`. It is configured to listen on port 8080. Environment variables like `PORT`, `EPL_WEB_PORT`, and `EPL_WEB_HOST` can override the default binding and port at runtime. The default bind host is `127.0.0.1` (localhost). ``` -------------------------------- ### Start EPL REPL Source: https://github.com/abneeshsingh21/epl/blob/main/README.md Launch the interactive Read-Eval-Print Loop for EPL. ```bash epl repl ``` -------------------------------- ### Initialize and Run an EPL Project Source: https://github.com/abneeshsingh21/epl/blob/main/docs/package-manager.md Quickly set up a new EPL project, install packages, and run your application. Use `epl serve` for web-related starters. ```bash # Initialize a new project epl init my-project epl new my-project --template web cd my-project # Install a package epl install epl-math epl install epl-web epl install owner/repo # List installed packages epl packages # Run your project epl run epl serve # for web/api/frontend/auth/chatbot/fullstack starters ``` -------------------------------- ### Brutalist Install Command Snippet Source: https://github.com/abneeshsingh21/epl/blob/main/docs/index.html Displays a command-line interface snippet for installation, featuring a prompt, command, and a copy button. Uses brutalist design principles. ```html
$
npm install epl
``` -------------------------------- ### Install EPL for Production Serving Source: https://github.com/abneeshsingh21/epl/blob/main/docs/support-matrix.md Install EPL with production serving capabilities, including WSGI (Waitress, Gunicorn) and ASGI (Uvicorn, Hypercorn) support. This enables the generation of deploy/asgi.py and deploy/wsgi.py entrypoints. ```bash pip install "eplang[server]" ``` -------------------------------- ### Install EPL Package Source: https://github.com/abneeshsingh21/epl/blob/main/README.md Installs a package from the official EPL registry. Packages are automatically resolved from the registry. ```bash epl install epl-auth # Install a package epl install epl-math # Packages resolve from the official registry ``` -------------------------------- ### Start Local Development Server Source: https://github.com/abneeshsingh21/epl/blob/main/DEPLOYMENT.md Use this command to start a threaded development server with hot-reloading on localhost:3000. ```bash epl serve app.epl --dev # threaded dev server, hot-reload, 127.0.0.1:3000 ``` -------------------------------- ### Install EPL Science Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-science/README.md Use this command to install the EPL Science Package. Ensure EPL is set up in your environment. ```bash epl use epl-science ``` -------------------------------- ### List all Todos using cURL Source: https://github.com/abneeshsingh21/epl/blob/main/examples/todo_app/README.md Example of retrieving all todo items using a GET request to the /todos endpoint. ```bash # List all todos curl http://localhost:8000/todos ``` -------------------------------- ### Install websocket-client for EPL Source: https://github.com/abneeshsingh21/epl/blob/main/examples/discord_agent/README.md Install the necessary Python package for EPL's WebSocket connectivity. This is a prerequisite for running the Discord bot. ```powershell pip install websocket-client ``` -------------------------------- ### Quick Start: Create and Publish an EPL Package Source: https://github.com/abneeshsingh21/epl/blob/main/docs/publishing.md Follow these steps to quickly create, initialize, and publish your first EPL package. Ensure you are logged in using 'epl login' before publishing. ```bash # 1. Create your package mkdir my-package && cd my-package # 2. Initialize with a manifest cat > epl.toml << 'EOF' [project] name = "my-package" version = "1.0.0" description = "A useful utility library for EPL" author = "Your Name" license = "MIT" entry = "src/main.epl" keywords = ["utils", "helpers"] [dependencies] EOF # 3. Write your code mkdir src echo 'Function hello takes name Return "Hello, " + name + "!" End' > src/main.epl # 4. Login (one time) epl login # 5. Publish epl publish --repo yourname/my-package ``` -------------------------------- ### Quick Start: Iris Dataset Classification Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-learn/README.md A quick start example demonstrating how to load the Iris dataset, split it into training and testing sets, train a Random Forest classifier, make predictions, and evaluate accuracy using the EPL Learn package. ```epl Use "epl-learn" -- Load dataset Set data to load_iris_dataset() Set X to data["X"] Set y to data["y"] -- Split into train/test Set split to split_data(X, y, 0.2) -- Create and train classifier Set classifier to create_random_forest_classifier(100, 10) train_model(classifier, split["X_train"], split["y_train"]) -- Make predictions Set predictions to predict(classifier, split["X_test"]) -- Evaluate Set acc to accuracy_score(split["y_test"], predictions) Say "Accuracy: " + acc ``` -------------------------------- ### Install Official EPL Packages Source: https://github.com/abneeshsingh21/epl/blob/main/docs/package-manager.md Installs supported facade packages like `epl-web`, `epl-db`, and `epl-test` like any other package. ```bash epl install epl-web epl install epl-db epl install epl-test ``` -------------------------------- ### Serve Web App (Production) Source: https://github.com/abneeshsingh21/epl/blob/main/examples/README.md Starts a production server for an EPL web application. ```bash epl serve examples/webapp.epl ``` -------------------------------- ### Install and Run EPL Code Source: https://github.com/abneeshsingh21/epl/blob/main/llms.txt Install EPL using pip and run a file. The `epl run` command executes on a bytecode VM by default, or use `--interpret` for the tree-walking interpreter. ```bash pip install eplang ``` ```bash epl run file.epl ``` ```bash epl run --interpret file.epl ``` -------------------------------- ### Validate Docker Compose Configuration and Startup Source: https://github.com/abneeshsingh21/epl/blob/main/docs/troubleshooting.md Check the Docker Compose configuration and start the services in detached mode with build. Ensure Docker is installed and running. ```bash docker compose -f deploy/docker-compose.yml config docker compose -f deploy/docker-compose.yml up -d --build ``` -------------------------------- ### Create a New EPL Project Source: https://github.com/abneeshsingh21/epl/blob/main/docs/getting-started.md Initialize a new EPL project with a specified template (e.g., 'web') and navigate into the project directory. Then, serve the project. ```bash epl new myproject --template web cd myproject epl serve ``` -------------------------------- ### For Loop: Multiplication Table Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html The 'For' loop with a numeric range is ideal when a counter variable is needed and its start and end values are known. This example prints a multiplication table. ```EPL For i from 1 to 10 product = 7 * i Say "7 x $i = $product" End ``` -------------------------------- ### Initialize EPL Project Source: https://github.com/abneeshsingh21/epl/blob/main/docs/package-manager.md Creates a new project directory with an `epl.toml` manifest and `main.epl` entry point. ```bash epl init [project-name] ``` -------------------------------- ### Serve Server-Rendered UI Showcase Source: https://github.com/abneeshsingh21/epl/blob/main/examples/official_starters/README.md Starts the server-rendered UI showcase application. Access the UI by opening the provided URL in your browser. ```bash epl serve creative_frontend/main.epl ``` ```bash # Open http://localhost:8080 in your browser ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/abneeshsingh21/epl/blob/main/frontend-starter/README.md Sync manifest-managed dependencies for the project. ```bash # Sync manifest-managed dependencies epl install ``` -------------------------------- ### EPL Web Server Setup and Routes Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Sets up the EPL web server, defines routes for fetching all books, searching books, and generating an overdue loans report. Requires importing database and model modules. ```epl Import "db/migrations.epl" Import "models/book.epl" Import "models/loan.epl" db = real_db_connect("library.db") books = BookRepository() books.setup(db) loans = LoanService() loans.setup(db, books) server = web_server_create() web_server_set_port(server, 8080) web_server_route(server, "GET", "/books", lambda req: web_response(200, "application/json", to_json(books.get_all()))) web_server_route(server, "GET", "/books/search", lambda req: web_response(200, "application/json", to_json(books.search(req["query"]["q"])))) web_server_route(server, "GET", "/loans/overdue", lambda req: web_response(200, "application/json", to_json(loans.overdue_report()))) Say "Library API running on :8080" web_server_start(server) ``` -------------------------------- ### EPL Project Initialization and Build Source: https://github.com/abneeshsingh21/epl/blob/main/docs/tutorials.md Covers the command-line interface for EPL projects, including initializing a new project, installing packages, running, and building the project. ```bash epl init my-app cd my-app ``` ```bash epl install epl-math epl install epl-test ``` ```bash epl main.epl ``` ```bash epl build main.epl ``` -------------------------------- ### SQL Module Example Source: https://github.com/abneeshsingh21/epl/blob/main/docs/stdlib-reference.md Demonstrates opening an in-memory SQLite database, creating a table, inserting data, counting rows, and closing the connection. ```epl Import "sql" as SQL Create conn equal to SQL.open(":memory:") SQL.execute(conn, "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)") SQL.execute(conn, "INSERT INTO users (name) VALUES ('Alice')") Say SQL.count(conn, "users") SQL.close(conn) Note: prints 1 ``` -------------------------------- ### Create a REST API with EPL Source: https://github.com/abneeshsingh21/epl/blob/main/docs/intro.md Shows how to create a simple REST API for managing todos using EPL. This involves setting up a web application, interacting with a SQLite database, and defining routes for GET and POST requests. The app can be started using the `epl serve` command. ```epl Create WebApp called app db = db_open("todos.db") db_create_table(db, "todos", Map with id = "INTEGER PRIMARY KEY AUTOINCREMENT" and title = "TEXT NOT NULL" and done = "INTEGER DEFAULT 0") Route "/api/todos" responds with todos = db_query(db, "SELECT * FROM todos") Return Map with success = True and data = todos End Route "/api/todos" responds with body = request_body() db_execute(db, "INSERT INTO todos (title) VALUES (?)", [body.get("title")]) Return Map with success = True End app.start(8000) ``` ```bash epl serve todo.epl # Production server starts on http://localhost:8000 ``` -------------------------------- ### Reproducible Package Installs with EPL Source: https://github.com/abneeshsingh21/epl/blob/main/docs/migration-guide.md Steps for ensuring reproducible package installations using `epl install` and `epl install --frozen`. Commit `epl.lock` to enable frozen installs. ```bash epl install commit epl.lock use epl install --frozen in CI and release automation ``` -------------------------------- ### Serve Web App (Development) Source: https://github.com/abneeshsingh21/epl/blob/main/examples/README.md Starts a development server for an EPL web application with hot-reloading enabled. ```bash epl serve examples/webapp.epl --dev ``` -------------------------------- ### Run All Three EPL Starters Source: https://github.com/abneeshsingh21/epl/blob/main/examples/official_starters/README.md Launches all three EPL starter applications simultaneously on different ports. Ensure each application is served on its designated port. ```bash # Auth API on port 8080 (default) epl serve auth_api/main.epl ``` ```bash # Chatbot on port 8081 epl serve chatbot/main.epl --port 8081 ``` ```bash # Creative frontend on port 8082 epl serve creative_frontend/main.epl --port 8082 ``` -------------------------------- ### Serve EPL Application (Development) Source: https://github.com/abneeshsingh21/epl/blob/main/README.md Start a development server for an EPL application. ```bash epl serve app.epl # Dev server ``` -------------------------------- ### Install EPL Package Source: https://github.com/abneeshsingh21/epl/blob/main/docs/publishing.md Installs an EPL package from the central index. You can also install directly from a GitHub repository. ```bash epl install my-package ``` ```bash epl install github:yourname/my-package ``` -------------------------------- ### EPL Basics: Hello World Source: https://github.com/abneeshsingh21/epl/blob/main/docs/playground.html A simple EPL example to print 'Hello, World!' and 'Welcome to EPL!' to the output. ```epl Say "Hello, World!" Say "Welcome to EPL!" ``` -------------------------------- ### Create and Configure EPL Web Server Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Initializes a web server instance and sets the port. The server must be started separately. ```EPL server = web_server_create() web_server_set_port(server, 8080) ``` -------------------------------- ### Verify EPL Installation Source: https://github.com/abneeshsingh21/epl/blob/main/docs/getting-started.md Verify that EPL has been installed correctly by checking its version. This command confirms the installation was successful. ```bash epl --version ``` -------------------------------- ### EPL Array Package Quick Start Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-array/README.md Demonstrates basic array creation and operations using the EPL Array Package. Ensure 'epl-array' is used before executing. ```epl Use "epl-array" -- Create arrays Set my_array to create_array([1, 2, 3, 4, 5]) Set zeros to array_of_zeros([3, 3]) Set ones to array_of_ones([2, 4]) -- Array operations Set result to add_arrays(my_array, my_array) Say "Sum: " + sum_of_array(result) Say "Mean: " + mean_of_array(result) -- Linear algebra Set matrix to create_array([[1, 2], [3, 4]]) Set inv to inverse_of(matrix) Set det to determinant_of(matrix) Say "Determinant: " + det ``` -------------------------------- ### Generate Range (start, end) Source: https://github.com/abneeshsingh21/epl/blob/main/docs/EPL_SYNTAX_REFERENCE.txt Creates a list of integers starting from the specified start value up to (but not including) the end value. ```EPL Print range(2, 5) ``` -------------------------------- ### Fix Stale Lockfile for Frozen Installs Source: https://github.com/abneeshsingh21/epl/blob/main/docs/troubleshooting.md If `epl install --frozen` fails due to a stale lockfile, first run `epl install`, verify dependencies, regenerate `epl.lock`, and then rerun the frozen install. ```bash epl install epl install --frozen ``` -------------------------------- ### Run Auth Starter Project Tests Source: https://github.com/abneeshsingh21/epl/blob/main/auth-starter/README.md Command to execute tests for the auth-starter project. ```bash epl test tests/ ``` -------------------------------- ### Serve EPL Application Source: https://github.com/abneeshsingh21/epl/blob/main/docs/EPL_GROWTH_ROADMAP.md Use this command to start the production web server for your EPL application. ```bash epl serve app.epl ``` -------------------------------- ### Hello CLI Example Source: https://github.com/abneeshsingh21/epl/blob/main/docs/examples.md A simple EPL script to print a greeting and interact with the user. Run this script using the 'epl run' command. ```epl Say "Hello from EPL" Ask "What is your name? " store in name Say "Welcome, $name" ``` ```bash epl run hello.epl ``` -------------------------------- ### EPL Package Management: Create and Use Source: https://github.com/abneeshsingh21/epl/blob/main/docs/tutorials.md Guides on creating a reusable EPL package with a manifest file (`epl.toml`) and entry point script (`main.epl`), and then publishing and consuming it in other projects. ```toml [project] name = "my-utils" version = "1.0.0" description = "My utility functions" entry = "main.epl" [dependencies] ``` ```epl Function double takes x Return x * 2 End Function is_even takes n Return n % 2 == 0 End ``` ```bash epl check main.epl epl pack . epl publish . ``` ```bash epl install my-utils ``` ```epl Import "my-utils" Say double(21) Note: 42 Say is_even(4) Note: true ``` -------------------------------- ### Install EPL Cloud Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-cloud/README.md Install the EPL Cloud package using pip. This command installs the necessary libraries for AWS cloud integration. ```bash pip install "eplang[cloud]" ``` -------------------------------- ### Generate Range (start, end, step) Source: https://github.com/abneeshsingh21/epl/blob/main/docs/EPL_SYNTAX_REFERENCE.txt Creates a list of integers starting from the specified start value, incrementing by the step value, up to (but not including) the end value. ```EPL Print range(0, 10, 3) ``` -------------------------------- ### Install EPL using pip Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Use pip, Python's package manager, to install EPL. This is the recommended method for most users. After installation, you can verify it by checking the EPL version. ```bash pip install eplang ``` ```bash epl --version # Should print: EPL 1.x.x ``` -------------------------------- ### List Installed EPL Packages Source: https://github.com/abneeshsingh21/epl/blob/main/docs/llms-full.txt Display all packages currently installed in the project. ```bash epl packages # List installed packages ``` -------------------------------- ### Install EPL DataFrame Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-dataframe/README.md Use this command to install the epl-dataframe package. ```bash epl use epl-dataframe ``` -------------------------------- ### Basic GUI Window Creation Source: https://github.com/abneeshsingh21/epl/blob/main/docs/llms-full.txt Create a simple desktop application window with basic widgets like labels, text boxes, and buttons. Requires running with `epl gui app.epl`. ```epl Note: A window (tkinter-based). Run with: epl gui app.epl Window "My App" 800 by 600 Column Label "Welcome to My Desktop App" TextBox "name" placeholder "Enter your name" Button "Save" does saveName TextArea "output" placeholder "Output appears here" End End Function saveName Say "Name saved!" End ``` -------------------------------- ### Open, Create, Insert, Query, and Close SQLite Database Source: https://github.com/abneeshsingh21/epl/blob/main/docs/guides/database.md Demonstrates the basic workflow for interacting with a SQLite database using `db_*` helpers. This includes opening a connection, creating a table, inserting data, querying records, and closing the connection. ```epl db = db_open("myapp.db") db_execute(db, "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT NOT NULL UNIQUE, active INTEGER NOT NULL DEFAULT 1)") db_execute(db, "INSERT INTO users (name, email) VALUES (?, ?)", ["Alice", "alice@example.com"]) users = db_query(db, "SELECT id, name, email, active FROM users ORDER BY id") Say users db_close(db) ``` -------------------------------- ### HTTP GET Request Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-http/README.md Performs an HTTP GET request to the specified URL. ```APIDOC ## http_get(url) ### Description Performs an HTTP GET request to the specified URL. ### Method GET ### Endpoint `url` (string) - The URL to send the GET request to. ### Parameters #### Path Parameters - **url** (string) - Required - The URL to fetch data from. ### Request Example ```epl Set response to http_get("https://api.example.com/users") ``` ### Response #### Success Response (200) - **response** - The HTTP response object. #### Response Example ```json { "example": "response object" } ``` ``` -------------------------------- ### Web Server: Create Server Source: https://github.com/abneeshsingh21/epl/blob/main/docs/epl_book.html Initializes and returns a new HTTP server object. ```epl web_server_create() ``` -------------------------------- ### Install epl-collections Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-collections/README.md Use this command to install the epl-collections package into your EPL environment. ```bash epl install epl-collections ``` -------------------------------- ### Generate Starter Templates Source: https://github.com/abneeshsingh21/epl/blob/main/docs/guides/web.md Commands to generate new projects using various EPL starter templates for web applications, APIs, authentication, chatbots, frontends, and full-stack applications. ```bash epl new mysite --template web epl new myapi --template api epl new myauth --template auth epl new mybot --template chatbot epl new myui --template frontend epl new myapp --template fullstack ``` -------------------------------- ### Install epl-db Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-db/README.md Use this command to install the epl-db package within your EPL environment. ```bash epl use epl-db ``` -------------------------------- ### Install EPL Array Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-array/README.md Use this command to install the epl-array package in your EPL environment. ```bash epl use epl-array ``` -------------------------------- ### Create New EPL Project Source: https://github.com/abneeshsingh21/epl/blob/main/docs/release-checklist.md Initialize a new project using the EPL CLI. This is a basic check to ensure project creation works. ```bash epl new ``` -------------------------------- ### Install a Single EPL Package Source: https://github.com/abneeshsingh21/epl/blob/main/docs/package-manager.md Installs a specified package, updates the manifest, and generates/updates the lockfile. ```bash epl install epl-math ``` -------------------------------- ### Initialize SQLite Database Source: https://github.com/abneeshsingh21/epl/blob/main/docs/tutorials/02_todo_sqlite.md Use `db_open` to create or open a SQLite database file and `db_execute` to run SQL commands for table creation. Ensure the table is created only if it doesn't already exist. ```epl Display "Initializing Database..." db = db_open("tasks.db") db_execute(db, "CREATE TABLE IF NOT EXISTS todos (id INTEGER PRIMARY KEY, task TEXT, done INTEGER)") ``` -------------------------------- ### Install EPL Plot Package Source: https://github.com/abneeshsingh21/epl/blob/main/epl/official_packages/epl-plot/README.md Use this command to install the epl-plot package. Ensure you have the EPL environment set up. ```bash epl install epl-plot ``` -------------------------------- ### Serve EPL WebApp with Custom Port Source: https://github.com/abneeshsingh21/epl/blob/main/docs/troubleshooting.md Start the EPL web server on a specific port. Ensure the entry file creates an EPL WebApp and the process runs from the project root. ```bash epl serve --port 8080 ``` -------------------------------- ### Write and Run First EPL Program Source: https://github.com/abneeshsingh21/epl/blob/main/docs/getting-started.md Create a simple EPL file and run it using the EPL interpreter. This demonstrates the basic syntax for outputting text. ```epl Say "Hello, World!" ``` ```bash epl hello.epl ``` -------------------------------- ### Install EPL Source: https://github.com/abneeshsingh21/epl/blob/main/docs/getting-started.md Install EPL using pip. This command is used to add the EPL package to your Python environment. ```bash pip install eplang ```