diff --git a/.circleci/config.yml b/.circleci/config.yml index 2cf3d68..8680f3a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,15 +7,29 @@ jobs: steps: - checkout - run: npx prettier . --check + # Install dependencies + - run: npm ci + # TODO : do we need caching for dependencies? + # Build the application + - run: npm run build # TODO: check that style.css matches compiled tailwind + # Store the build artifacts to be used in the deploy job + - persist_to_workspace: + root: . + paths: + - dist + - scripts deploy: docker: - # specify the version you desire here - image: cimg/node:20.8.1 working_directory: ~/repo steps: - checkout + # Attach the workspace with the build artifacts + - attach_workspace: + at: . + # Deploy using the script - run: ./scripts/deploy.sh workflows: diff --git a/.gitignore b/.gitignore index d9e5e60..c962116 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ pnpm-debug.log* lerna-debug.log* node_modules +dist +dist-ssr *.local # Editor directories and files diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 009ba8f..0000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -public/style.css \ No newline at end of file diff --git a/README.md b/README.md index 4868384..eaa1b00 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ [](https://techforpalestine.org/learn-more) +## Get started + +- `npm i` to install dependencies +- `npm run dev` to build and watch the CSS + ## Formatting To format, use VSCode Prettier extension, or run: @@ -13,7 +18,7 @@ To check it: `npx prettier --check .` Formatting in checked in CI -## Start the Tailwind CLI build process -To build and watch the CSS, use the following command: -`npm run dev` +## TODOs +- [ ] is there a better way than `~/assets/...` to reference things? + `~/assets/..` \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..79a552e --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,28 @@ +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + { ignores: ["dist"] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ["**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + "react-refresh/only-export-components": [ + "warn", + { allowConstantExport: true }, + ], + }, + }, +); diff --git a/index.html b/index.html new file mode 100644 index 0000000..f1507ac --- /dev/null +++ b/index.html @@ -0,0 +1,25 @@ + + +
+ + + + + + + + +- #FreePalestine. - Read our founder's - statement -
-- Dark is a new - way of building serverless backends. Just code your backend, with no - infra, framework or deployment nightmares. Build - APIs, - CRUD apps, - internal tools and - bots - whatever your backend - needs. -
- -- The classic version of darklang is still accessible but is currently - in maintenance mode, with no ongoing development. Darklang-next is the - next iteration of Dark, applicable to both the cloud runtime and to - local scripts and CLIs -
-- Dark lets you build any backend that needs API endpoints, data stores, - background workers, scheduled jobs, and calling HTTP APIs. You just - write the code in Dark, and we'll manage the rest. -
-see it in action!
-- REPLACE ME -
- - - -- REPLACE ME -
- - - -- REPLACE ME -
- - - -- We're currently focused on the - next version - of Darklang, but you can still try Darklang Classic! -
-- #FreePalestine. - Read our founder's - statement -
-- no cruft: no build systems, no - null, no exception handling, no ORMs, no OOP, no inheritence - hierarchies, no async/await, no compilation, no dev environments, - no dependency hell, no packaging, no git, no github, - - no devops: no yaml, no config - files, no docker, no containers, no kubernetes, no ci/cd - pipelines, no terraform, no orchestrating, - - no infrastructure: no sql, no - nosql, no connection poolers, no sharding, no indexes, no servers, - no serverless, no networking, no load balancers, no 200 cloud - services, no kafka, no memcached, no unix, no OSes -
-- Darklang puts everything in one box, so you can build CLIs and cloud - apps with no bullshit, - just - code. -
-- ️️️Also it's a really enjoyable language to use! -
-- Looking for Darklang-classic? -
- -- - $ curl https://darklang.com/download | bash - - Darklang installed in ~/.darklang/bin/darklang - - Add to PATH via .bashrc [y, n, ?]: y - ✔Added to .bashrc. - - Next you can:-# Try the tutorial darklang tutorial# Run some code from the package manager darklang @paul.fizzbuzz 3# Generate some code darklang prompt "Find ts scripts with more than 600 lines which use the commonjs format"# See available command line options darklang help - -
-
- $ darklang @paul.fizzbuzz 3
- 1
- 2
- Fizz
-
-
-
-
- $ darklang deploy @paul.fizzbuzz /fizzbuzz
- Deployed to https://furry-squirrel-3562.darklang.io/fizzbuzz in 0.135s
-
-
-
-
- $ curl -sSO https://furry-squirrel-3562.darklang.io/fizzbuzz/3
- 1
- 2
- Fizz
-
-
- - - $ darklang prompt "Find ts scripts with more than 600 lines which use commonjs format" - - We need your AI credentials, which will be stored locally in ~/darklang/secrets/ - - [1] Login to use Darklang AI service - [2] Enter GitHub copilot credentials - [3] Enter OpenAI (GPT 3.5/4) credentials - [4] Use local model - - Enter [1-4]: 1 - - Login or register [L, r]? L - Username: paul - Password: ************** - - ✔Logged in. - - Saved script in ./find-large-ts-cjs.dark in 43.8s - --
find-large-ts-cjs.dark
--let findLargeTypescriptCommonJSFiles (path : String) = - Directory.traverse (fun path -> - if not (List.oneOf (File.extension path) [".ts", ".mjs", ".cjs"]) then - print $"Skipping - wrong file type: {path}" - else - let contents = File.readString path - let lines = String.splitNewlines contents - if (List.length lines) <= 600 then - print $"Skipping - too short: {path}" - else - let isCommonjs = - lines |> List.any (fun line -> - line |> Regex.matches "/const .* = require(.*)/" - ) - if isCommonjs then - print $"Found one: {path}" - ) - -findLargeTypescriptCommonJSFiles "./"
--// Record -type Url = { - scheme : HttpScheme - domain : String - port : UInt16 - path : String - query : Option<String> -} - -// Enum (aka Variant, Sum Type, or Abstract Data Types) -type UrlError = - | InvalidScheme(String) - | EmptyDomain - | InvalidPort(Int64) - | Unparseable(msg:String, context:String) - -// Aliases are just shorthands -type UrlParseResult = Result<Url, UrlError> - -
- -$ darklang @paul.fizzbuzz 10 -1 -2 -Fizz -4 -Buzz -Fizz -7 -8 -Fizz -Buzz
-$ darklang @hacker.stealThings "Hi there" -> @hacker.stealThings requires the following permissions -> Makes Http requests to unknown domains -> Reads any file -> Executes any file -> Continue? [N, y] y -> These are unusual permissions. Are you sure [N, y] y -Ha ha, you're own3d - -$ darklang @mycompany.internal.createMonthlyReport -> @mycompany.internal.createMonthlyReport requires the following -> permissions -> Makes Http GET requests to stripe.com/api/ETC -> Makes Http POST requests to drive.google.com -> Continue? [N, y] y -Report initiated and stored at https://drive.google.com/u/asj599b3/5288942sdfsdf3.pdf
- When you make an async request, it first waits for any arguments - that are async, and starts when they're done. If another - function call needs to use the result, it will wait for it - before starting. -
-- Since darklang values are immutable, there won't be any race - conditions from this. -
--
- - - - - - - - -- REPLACE ME -
- - - -- REPLACE ME -
- - - - - REPLACE ME - - - - -- REPLACE ME -
- - - -- REPLACE ME -
- - - - - See example - - - - - - - - - -REPLACE ME
-
-
- REPLACE ME
-
-
-
- REPLACE ME
-
-
-
- REPLACE ME
-
-
-
-
- + {codeSample} ++
+
+
+ + {description} +
+ )} ++## Generally + +## For your development +- very generous parser +- import/export to other languages using AI +- support copilot +- redesigned to support AI +- bring-your-own-model + + +## For your users + + +- (bullets from "designed for GenAI") +- "built for AI" +- build vendor SDKs automagically +- prompt using your AI, or ours +- build AI models in darklang +- agents +- packages for integrating with OpenAI or other models +- support for local whatever +- future: native support for vector DBs? +- alternative to langchain + - prompt pipelines, etc + ++ ); +}; + +export default AI; diff --git a/src/pages/Backends/index.tsx b/src/pages/Backends/index.tsx new file mode 100644 index 0000000..e9719f0 --- /dev/null +++ b/src/pages/Backends/index.tsx @@ -0,0 +1,72 @@ +import React from "react"; + +const Backends: React.FC = () => { + return ( +
+ talk about features + http handlers + CRONs + workers + etc. + + talk about our cloud offerings + reference things in dark-classic + + talk about eventual migration from -classic to -next ++ +
+ Darklang is a programming language and platform designed to simplify backend development by removing much of the complexity associated with traditional backend infrastructure. Its backend features are tightly integrated into a single environment, and built to streamline the creation of cloud-native applications without managing infrastructure, deployments, or containers. +
+ +Darklang’s backend features—HTTP handlers, scheduled jobs (CRONs), background workers, and datastores are designed for rapid development and prototyping, with a focus on simplicity and instant deployment.
+ ++ Datastores: + - Datastores in Darklang are key-value stores used for persistent data storage, integrated seamlessly with handlers and workers. + - when you set up a database in dark, you just add the database, like you click a button or a keyboard shortcut, no requiring a server from somewhere to put it on, no going to another server, no config, no orm it is written in the same language as the rest of your code + - when you make a query, you query in the dark + + talk about operations? + - (DB.set, DB.get...) + - (DB.query...) +
+ ++ HTTP Handlers: + - HTTP handlers in Darklang are the core mechanism for handling incoming HTTP requests, serving as the entry point for API endpoints and web applications. + - when setting up a HTTP request you're not setting up a HTTP server, you're just add an end point that is directly connected to the code and you write them in the same place. There's no spinning up servers + - Darklang is designed for interacting with 3rd party APIs over HTTP. The `HttpClient` module has a set of functions for calling out to other HTTP services and APIs +
++ Scheduled jobs: + - CRON jobs in Darklang are scheduled tasks that run on a predefined schedule, similar to Unix cron, ideal for periodic tasks like report generation or data cleanup. + - Crons run automatically once per interval +
+ ++ Background Workers: + - Workers in Darklang handle asynchronous background tasks, processing messages from a queue, making them ideal for tasks like API calls, batch processing, or report generation. + - Darklang supports doing work asynchronously outside the context of an HTTP handler using a **Worker**. Each worker has a queue of messages, which are processed loosely in-order, executing the code within the Worker once for each message. Messages are created by calling `emit` from any other code, and can contain arbitrary event data. + + ADD Example use case? +
++ Darklang CLI is a better replacement for traditional file-based + scripts, such as in bash, python, lua, js, etc. +
+ ++ bash is super hard to read, using weird variable names. While lots + of us can read and write bash scripts, since there are few + experts, it's not a great language. +
+ ++ Darklang is used as a better language for scripts: +
+ +# Try the tutorial
+darklang tutorial
++ # Run some code from the package manager darklang +
+@paul.fizzbuzz 3
+# Generate some code
++ darklang prompt{" "} + + "Find ts scripts with more than 600 lines which use the commonjs + format" + +
++ # See available command line options +
+darklang help
++ Write your first script in Darklang today and have it running in + minutes +
+ ++ We're currently focused on the{" "} + + next{" "} + + version of Darklang, but you can still try Darklang Classic! +
++ Thank you for signing up. Check your email for further + instructions. +
++ Already have an account?{" "} + + Log in + +
++ The Classic version of Darklang is still accessible but is currently + in maintenance mode, with no ongoing development. Darklang-next is + the next iteration of Dark, applicable to both the cloud runtime and + to local scripts and CLIs +
++ Dark is ideal for quickly building slackbots and automating + internal tools. Receive webhooks live, call out to 3rd party + APIs, store data, and schedule jobs - while building no + infrastructure. +
+ + Read more about using dark with Slack + ++ Set up an API endpoint quickly enough to use it as a proof of + concept during a call. Immediately see the data from a webhook + to your endpoint. Call an external API using the HttpClient + library and see responses within the editor, or use workers to + do them in the background. Use the built-in package manager to + make external API calls really easily, and contribute your own + API integrations. +
++ Get a working CRUD application in less than ten minutes by + setting up a few API endpoints and a datastore. Build out the + backend for a web or mobile app, whether a simple HTML form or + an entire product. +
++ Dark lets you build any backend that needs API endpoints, data + stores, background workers, scheduled jobs, and calling HTTP APIs. + You just write the code in Dark, and we'll manage the rest. +
+ + + + {/* Access Darklang-classic CTA */} ++ Licensing + Cloud hosting + plz give us money + + burndown chart? + + { + // text: "Sponsor us", + // href: "https://github.com/sponsors/darklang", + // target: "_blank", + // }, +\ No newline at end of file diff --git a/src/pages/Company/index.tsx b/src/pages/Company/index.tsx new file mode 100644 index 0000000..2dc24f8 --- /dev/null +++ b/src/pages/Company/index.tsx @@ -0,0 +1,46 @@ +import React from "react"; + +const Company: React.FC = () => { + return ( +
+Darklang has been around in various form since xxxxxx. + +## Vision + +## Mission + +## Funding, Sustainability, Licensing, and Business Model + +In order to work on our mission, towards our vision, we must be sustainable. + +[sponsor, licensing] + +(if you're interested in giving us $, ...) + +## Branding + +(link to another page) + +## Roadmap + +- [...] + + +## Are we hiring? + +No, sorry, not currently. We're limited on funding. + + +## History +... + + Licensing + Cloud hosting + plz give us money + + burndown chart? ++ ); +}; + +export default Company; diff --git a/src/pages/Distribution/index.tsx b/src/pages/Distribution/index.tsx new file mode 100644 index 0000000..3e553c0 --- /dev/null +++ b/src/pages/Distribution/index.tsx @@ -0,0 +1,33 @@ +import React from "react"; + +const Distribution: React.FC = () => { + return ( +
+ package management + source control + building artifacts for end users ++
+ TODO: move this somewhere else
+
+ Darklang is a cloud-native programming language and platform designed to simplify the development of serverless backends by introducing a "deployless" model. This approach aims to remove the complexities of traditional software deployment, allowing developers to focus on writing code rather than managing infrastructure, builds, or deployment pipelines.
+
+ In traditional software development, deploying code involves multiple steps: writing code, committing it to a repository (e.g., via Git), creating pull requests, building assets, pushing containers to registries, and orchestrating deployments (e.g., via Kubernetes). Darklang eliminates roughly 60% of these steps by integrating the language, editor, and infrastructure into a cohesive platform. The result is a deployment process that takes approximately 50 milliseconds, enabling rapid iteration and testing in production.
+
+
+ The deployless model is analogous to serverless computing: just as serverless abstracts away server management, deployless abstracts away deployment management so that you don’t have to think about it
+
+ Developers don’t need to configure build systems, containers, Kubernetes, or CI/CD pipelines. The platform handles scaling, monitoring, and optimization
+
+ Feature flags allow developers to test code in production without exposing it to users, and precise access controls enhance security
+
+ No Infrastructure Management: Developers avoid configuring servers, databases, or networking components.
+
+ Developers spend less time on DevOps tasks, focusing on application logic
+
+ Darklang's language server is designed to work across multiple + editing environments, providing a consistent experience + regardless of your preferred editor. +
++ Our language server is fully written in Darklang and follows the + Language Server Protocol (LSP), providing features like + autocompletion, real-time error checking, and hover documentation. It + is currently integrated with a lightweight VS Code extension, and we + plan to support more editors like Vim, Rider, and Sublime in the + future. +
++ Many of our language tools are fully accessible to users. Just like + forking and editing your own code, you can fork the language server + to change how features like onHover, autocompletion, or diagnostics + work. +
+ ++ It's also easy to create your own language servers, whether for + testing new ideas or developing specialized tools +
++ We are currently focused on building a VS Code extension because of + its rich API ecosystem and powerful FileSystemProvider (FSP) + capabilities. Unlike traditional development where code exists as + plain text files on disk, Darklang's code is stored in a package + manager, making VS Code's FSP particularly valuable for our + implementation. +
+ ++ While VS Code is our starting point, we're actively planning support + for additional editors including Vim, Sublime Text, and Rider. +
++ Try the VS Code extension or use it instantly on{" "} + + editor.darklang.com + + ! +
++ interpeted + + TODO: compiler stuff + runtime typechecking [link to TC page] + + rough metrics of perf. + + link to github issues ++ ); +}; + +export default Execution; diff --git a/src/pages/For/index.tsx b/src/pages/For/index.tsx new file mode 100644 index 0000000..01c80cd --- /dev/null +++ b/src/pages/For/index.tsx @@ -0,0 +1,39 @@ +import React from "react"; + +const For: React.FC = () => { + return ( +
+I'm thinking to have a bunch of pages like +darklang.com/for/web-developers +with dedicated content for groups of folks who we think might appreciate Darklang. + +here are some ideas + +darklang.com/for/fsharp-developers +darklang.com/for/home-automation +darklang.com/for/eInk-devices +darklang.com/for/web-developers +darklang.com/for/people-with-money (letter asking them to invest etc?) +darklang.com/for/people-who-want-money (entrepreneurs? scripters? people with servers?) +darklang.com/for/security-nerds +darklang.com/for/unix-users +darklang.com/for/accessibility +darklang.com/for/AI-developers +darklang.com/for/lazy-people +darklang.com/for/folks-who-collect-domains +darklang.com/for/python-developers +darklang.com/for/web-scrapers (the web is ridden with flies, you can hardly see through. scrape the web and provide) also good for folks who are into those browser extensions... something monkey? that remove ads and such +darklang.com/for/privacy +darklang.com/for/local-first +darklang.com/for/small-businesses (SSG; wordpress alt.; affordable software solutions and contracting) + + + + +in each of these, include expandable section for context for those outside the know + ++ ); +}; + +export default For; diff --git a/src/pages/GettingStarted/index.tsx b/src/pages/GettingStarted/index.tsx new file mode 100644 index 0000000..da2b88b --- /dev/null +++ b/src/pages/GettingStarted/index.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +const GettingStarted: React.FC = () => { + return ( +
+ Not sure if we should point to devcontainer yet + , or just say "wait a bit" + , or something else. ++ ); +}; + +export default GettingStarted; diff --git a/src/pages/Home/AsyncRuntime.tsx b/src/pages/Home/AsyncRuntime.tsx new file mode 100644 index 0000000..09d254a --- /dev/null +++ b/src/pages/Home/AsyncRuntime.tsx @@ -0,0 +1,122 @@ +import React from "react"; + +import SectionTitle from "../../common/ui/SectionTitle"; + +interface FeatureCardProps { + title: React.ReactNode; + description: React.ReactNode; + className?: string; +} + +const FeatureCard: React.FC
+ Adding async and await keywords to every language was a + mistake. It exposes the complexity of concurrency and + multi-threading to languages which were originally designed + for simplicity. +
+ } + /> ++ When you make an async request, it first waits for any + arguments that are async, and starts when they're done. If + another function call needs to use the result, it will wait + for it before starting. +
++ Since darklang values are immutable, there won't be any race + conditions from this. +
++ Darklang has a fully asynchronous runtime, so making a Http + call or reading a file doesn't block the runtime. +
+ } + /> + ++ We provide powerful escape hatches if you need async ordering + that doesn't match the data dependencies of your program. +
+ } + /> ++ Darklang lets you easily develop backend applications, seamlessly deployable to the cloud. + You can build tiny applications to connect two services, or large scale applications with tens of thousands of users. + Code is written in + collaboration with AI and is instantly and safely deployed on our + hosted platform or yours, so you can focus on writing code while we + handle the rest +
+ ++ You can build any backend that needs: +
++ Darklang's CLI is a better alternative to Bash, combining its + power with the simplicity and safety of modern programming + languages. Enabling you to write scripts without confusing + errors or dependency issues. +
++ Using static types to help ensure correctness +
++ No Npm install, no dependency headaches +
++ Running on macOS, Linux, and Windows +
+{description}
++ Edit code in your preferred environment—whether it's your local + editor, a browser-based IDE, or directly in the CLI. This is + made possible by Darklang's Language Server: +
++ {feature.description} +
++ Gradual Static Typing allows running incomplete programs so you don't + need to ensure everything type checks when you're getting one path + working +
+ ++ {point.text} +
++ Darklang is an integrated language, framework, runtime, and editor for + building software— CLI scripts and REPLs, cloud apps, and more +
+ ++ Write simple code that runs + everywhere. No setup.{" "} + Just code. +
+ + + + {/* GIF placeholder */} + {/* */} ++ Darklang is a statically-typed functional language built for + simplicity and composability. No null, no unexpected exceptions + —just predictable code that's easy to write, read, and maintain. +
+ ++ Get notified about new features, updates, Bug Fixes, project + milestones, and more +
++ Darklang has a rather unique package manager built directly into the + runtime, where functions and types are individually versioned and + immutable, taking a lot of the hassle out of package management. +
++ {feature.description} +
++ The best way to debug and refactor code is with the help of{" "} + + real user data + + . As your code executes, whether{" "} + + locally + {" "} + or in the{" "} + + cloud + + , traces are captured and made available in your development + workflow, making it easier to refactor code and debug issues. +
+ ++ Traces are captured centrally in the package manager, stored + locally first, and securely available in your editing environment + - you control when and if they sync. +
+ + + See how traces work with real examples → + ++ it's an ML-style language yay ++ +
+ Darklang is a statically-typed, functional/imperative hybrid programming language designed primarily for building cloud-based backend services. Its functional aspects draw inspiration from languages like OCaml, Elm, and Rust, emphasizing simplicity, type safety, and productivity while avoiding complex functional programming concepts like monads or category theory. +
+ ++ Immutability: + Darklang embraces immutability, a core functional programming principle. Values in Darklang are immutable by default, eliminating race conditions in concurrent execution and making programs easier to reason about. +
+ ++ No Exceptions, Use of Results and Options: + Instead of exceptions, which can complicate reasoning in functional programming, Darklang uses Result and Option types to handle errors and optional values. This approach, inspired by languages like Rust and OCaml, ensures explicit error handling and avoids issues associated with nulls or unchecked exceptions. +
+ ++ First-Class Functions and Pipelines: + Darklang supports first-class functions, enabling functions to be passed as arguments, returned from other functions, and assigned to variables, a standard feature in functional languages. + It makes heavy use of pipelines (similar to F# or Elm), allowing developers to chain function calls in a readable, declarative way. For example, operations like List::map are used to transform collections functionally +
+ ++ Implicit Returns: + Like many functional languages (e.g., Elm or Haskell), Darklang uses implicit returns, where the last expression in a function is automatically its return value. This reduces boilerplate and aligns with functional programming’s focus on expressions over statements. +
+ ++ Simple Type System with Records and Enums: + Darklang employs a straightforward type system based on Records and Enums (also known as variants or sum types), similar to Rust, Elm, or OCaml. These types are expressive enough to model complex data structures while remaining simpler than object-oriented class hierarchies. + For example, a Url type might be defined as a record with fields like scheme, domain, and port, while a UrlError enum could represent possible errors like InvalidScheme or EmptyDomain. This approach avoids the complexity of inheritance and aligns with functional programming’s preference for algebraic data types. +
+ ++ Functional/Imperative Hybrid: + While primarily functional, Darklang is described as a functional/imperative hybrid, drawing from OCaml, Elm, and Rust rather than purely functional languages like Haskell. This hybrid nature makes it accessible to developers familiar with imperative or object-oriented languages, avoiding esoteric functional concepts like monads, lenses, or combinators. + The language prioritizes developer productivity by allowing imperative-style code where needed, but its functional core ensures type safety and immutability. +
+ ++ Asynchronous Programming Without await: + Darklang’s runtime is fully asynchronous, but it avoids the explicit await keywords common in languages like JavaScript or TypeScript. Instead, it uses data dependencies to manage concurrency, a functional approach that ensures operations wait for their inputs without exposing threading complexity. + This design eliminates race conditions (due to immutability) and simplifies concurrent programming, aligning with functional programming’s emphasis on declarative concurrency models. +
+ ++ Unicode-Aware Strings: + Darklang’s string handling is designed for modern applications, using Extended Grapheme Clusters to represent characters (e.g., emojis like 👨👩👦👦 are treated as single characters). This functional approach to string representation avoids the pitfalls of byte-based or UTF-16 strings in older languages, ensuring predictable behavior in text processing. +
+ ++ Reliability: Static typing and immutability ensure that compiled code is robust, a critical feature for cloud backends. + Concurrency: Immutability and data-driven async execution simplify concurrent programming, a key requirement for scalable backend services. + Productivity: Features like pipelines, implicit returns, and gradual typing make functional programming accessible and efficient, aligning with Darklang’s goal of simplifying backend development. +
+ ++ The page you're looking for doesn't exist or has been moved. +
++ At Darklang, we're committed to building a powerful yet simple + platform for backend development. Our roadmap outlines our vision for + the future and the features we're working on. +
+ ++ We believe in building in public and with our community. Have + suggestions or feature requests? We'd love to hear from you! +
+ ++ Traces are a core feature of Darklang that enable developers to work with live request data to build and debug applications efficiently. + Acting as an "omniscient debugger" traces provide complete visibility into the state of an application at any point in time, allowing developers + to see exactly what data flows through their code and how it behaves without needing traditional debugging tools like print statements or external loggers. + + Traces power Trace-Driven Development, a workflow where you start by sending requests to non-existent endpoints. + Darklang records those traces, which you then use to write code that handles real inputs. + This approach ensures code is developed with actual data, reducing guesswork and errors. + + Traces are records of HTTP requests (or other events) made to a Darklang app. Whether your code runs locally or in the cloud, + traces automatically capture inputs and intermediate values during execution for: + - HTTP handlers + - Worker `emit`s + - Function calls + - CRON responses + - CLI application calls + + A trace includes: + - Request Inputs: The full HTTP request, including headers, query parameters, body and metadata. + - Intermediate Values: Values computed during the execution of a handler, such as the results of expressions or function calls. + - Live Values: The evaluated results of expressions for a selected traceThese update in real-time as you write code. + - Return Values: The final output of a handler + + All traces are securely and centrally captured in the package manager, and made available in your editing environment. + This approach streamlines debugging, improves accuracy, and makes refactoring safer—all by letting real data guide the development process. +
+ ); +}; + +export default TraceDriven; diff --git a/src/pages/TypeChecking/index.tsx b/src/pages/TypeChecking/index.tsx new file mode 100644 index 0000000..e93c8f7 --- /dev/null +++ b/src/pages/TypeChecking/index.tsx @@ -0,0 +1,40 @@ +import React from "react"; + +const TypeChecking: React.FC = () => { + return ( ++ Runtime is done-ish + Parse-time is barely there ++ +
+ Type checking:
+ - Darklang is fully statically typed with Gradual Flexibility, ensuring that types are checked at compile time to catch errors early. This helps developers ensure that changes across large programs are safe, particularly for refactoring or scaling systems
+ - Unlike traditional functional languages where the entire program must compile, Darklang employs gradual static typing. This allows incomplete or partially typed code to run, enabling developers to prototype quickly without ensuring every part of the program type-checks immediately
+ - Darklang uses small compilation units, meaning that type checking is localized to specific parts of the program, such as a single HTTP route. This reduces the scope of type changes needed when prototyping or making small modifications
+ - Instead of modifying existing types, developers create a copy of a type, make changes, and test them. Once validated, semi-automated tooling helps propagate these changes across the program, minimizing the effort required for large-scale type updates.
+ - The language supports Option and Result types for error handling, replacing nulls and exceptions to avoid common pitfalls like null pointer errors
+ - Types and functions in Darklang are versioned and immutable, ensuring that changes don’t break existing code. This is particularly useful in the package manager, where types and functions are individually versioned
+ - When updating types, developers can test new versions without affecting the entire program, and tooling assists in migrating to the new type once it’s finalized.
+ - Future plans include implementing an at-rest/static checker to perform comprehensive type checking, including preventing invalid operations (e.g., adding a String and an Int). This will leverage Darklang’s access to trace data for advanced diagnostics
+
+ Benefits of Darklang’s Type Checking
+
+ - Safety: Static typing ensures type mismatches are caught early, reducing runtime errors and making large-scale changes safer
+ - Productivity: Small compilation units and gradual typing allow rapid prototyping, akin to dynamic languages, while retaining static typing benefits
+ - Error Handling: The Option/Result types simplify error management, eliminating the need for exceptions and reducing null-related bugs
+ - Maintainability: Versioned types and editor integration make refactoring and maintaining code easier, especially in evolving projects
+ - Diagnostics: Integration with trace data provides unique insights into type-related issues, improving debugging and development efficiency
+ - Scalability: Versioned types and small compilation units make it easier to scale and refactor backends as projects grow
+
+ TODO +
+ ); +}; + +export default TODO; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +///