@danielx/civet 0.5.26 → 0.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,13 +24,15 @@ Quickstart Guide
24
24
  ```bash
25
25
  # Install
26
26
  npm install -g @danielx/civet
27
- # Run civet code directly in a REPL
27
+ # Run Civet code directly in a REPL
28
28
  civet
29
- # Compile civet source file to typescript
29
+ # Transpile typed Civet code into TypeScript in a REPL
30
+ civet -c
31
+ # Compile Civet source file to TypeScript
30
32
  civet < source.civet > output.ts
31
- # Execute a simple civet script (no imports)
33
+ # Execute a simple .civet script (no imports)
32
34
  civet source.civet ...args...
33
- # Execute a civet source file in node using ts-node
35
+ # Execute a .civet source file in node using ts-node
34
36
  node --loader ts-node/esm --loader @danielx/civet/esm source.civet
35
37
  ```
36
38
 
@@ -455,3 +457,39 @@ esbuild.build({
455
457
  ```
456
458
 
457
459
  It's super fast and works great!
460
+
461
+ Philosophy
462
+ ---
463
+
464
+ Civet is a **large language that feels small**. Civet is large because it is mostly a **superset of TypeScript**,
465
+ an already large language. Civet feels small because of the coherent design aesthetic: related
466
+ features look and behave similarly, so when seeing a new feature you can have a good idea what it does,
467
+ and your existing knowledge of JavaScript and other languages leads you in the right direction.
468
+
469
+ Civet works with **existing tools**. We're not trying to replace the TypeScript type checker; we want to
470
+ amplify its power. We're not trying to change ES semantics; we want to present them in a coherent and expressive
471
+ way.
472
+
473
+ **Less syntax** is preferred.
474
+
475
+ **Context matters**. The same tokens can mean different things in different contexts. This shouldn't be arbitrary
476
+ but based on pragmatic concerns. Things should be consistent where possible, especially conceptually.
477
+
478
+ Civet builds on top of **history**. We've taken inspiration from languages like CoffeeScript, Elm, LiveScript, Flow,
479
+ Haskell, Perl, Python, Ruby, Crystal, Bash, and others.
480
+
481
+ Civet is **pragmatic**. Civet design is informed by 25+ years of JavaScript development. Frontend frameworks
482
+ have come and gone but they all addressed issues that were important for their time. We focus heavily on
483
+ addressing concerns that real developers feel every day. A key criteria for evaluating features is "how does it
484
+ work in practice?".
485
+
486
+ Civet **evolves**. As the official JS and TS specifications evolve into the future, Civet also evolves favoring **compatibility**.
487
+ This may lead us to difficult choices where the future spec has evolved differently than we anticipated (pipe operators,
488
+ do expressions, pattern matching). In those cases, Civet will adapt to match the latest spec while providing configuration
489
+ options to allow migration bit by bit while keeping existing code working.
490
+
491
+ Civet is **configurable**. There is no single "right way" for everyone at all times. Some of us have older CoffeeScript
492
+ codebases that would benefit from added types. Others have massive TypeScript applications that could benefit from
493
+ new language features and shorthand syntax. Civet provides a way to get the benefits bit by bit without a complete
494
+ rewrite. This same configurability lets us experiment with language features to gain experience and improve them before
495
+ locking them in. It also allows us to adapt to a changing future.