• Stars
    star
    330
  • Rank 127,657 (Top 3 %)
  • Language
    TypeScript
  • License
    BSD 3-Clause "New...
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Elm-inspired language that transpiles to TypeScript

derw

Welcome to Derw! Derw is a type-safe language in the ML family designed to replace or augment your TypeScript and JavaScript code - both on the client and the server. If you've never encountered an ML language before, some of the core principles - which Derw follows - is a clean and concise syntax, paired with a powerful type system. Here's some real world Derw code:

generateTypeAlias: TypeAlias -> string
generateTypeAlias syntax =
    let
        properties: string
        properties =
            List.map generateProperty syntax.properties
                |> (\y -> y.join ",\n    ")

        typeDef: string
        typeDef =
            generateType syntax.type
    in
        if syntax.properties.length == 0 then
            `type alias ${typeDef} = {\n}`
        else
            `type alias ${typeDef} = {\n    ${properties}\n}`

Why might you use Derw?

Derw is a language for those searching for a better syntax for writing type-heavy code. It is a general purpose language, for both the server and the client, built on top of the JavaScript platform. It has interop with Javascript and TypeScript built in - so that you can use existing code and libraries with minimal effort. Derw targets multiple languages - TypeScript, JavaScript, Elm, English and Derw itself. Derw's output generation is documented in the Gitbook, so it's easy to create code to interface between Derw and TypeScript.

If you want to write a website, both backend and frontend, Derw is a perfect choice for you.

Batteries built-in

  • A testing framework (all of Derw's compiler tests use this library!)
  • Performant web framework with server side rendering and hydration
  • Bundling built into the CLI
  • Write better code by leveraging a type system that guides your code.
  • Integrate with your existing code bases through interop with JavaScript and TypeScript.

Getting Started

Head over to the Gitbook.

Staying up to date

Homepage: https://www.derw-lang.com/

Blog: http://derw.substack.com/

Follow Derw on Twitter: https://twitter.com/derwlang

Name

derw (/ˈdeːruː/, Welsh β€œoak”) is one of the native trees in Wales, famous for long life, tall stature, and hard, good quality wood. An English speaker might pronounce it as β€œdeh-ru”.

More Repositories

1

take-home

A take-home application server written in Elm and only Elm
Elm
359
star
2

json-to-elm

Create Elm type aliases and decoders based on JSON input
Elm
279
star
3

servelm

Server-side Elm
Elm
117
star
4

elm-blogger

A blogging platform written in Elm + Elixir
Elixir
102
star
5

elm-server-side-renderer

Render elm on the server
Elm
99
star
6

elm-static-html

Statically render html from Elm!
JavaScript
89
star
7

elm-static-site

Static site generator using Elm
JavaScript
87
star
8

elm-phoenix

Phoenix helpers for Elm
Elm
74
star
9

elm-html-test

Test elm-html in Elm!
Elm
68
star
10

haskell-to-elm

68
star
11

elm-for-web-developers

A collection of tips for people using Elm from a web-dev background
56
star
12

elm-static-html-lib

TypeScript
56
star
13

elm-ffi

An FFI interface for Elm
Elm
50
star
14

elmxir

Interop tools for working with Elm in Elixir
Elixir
46
star
15

elm-all-dict

A dict for Elm which can store any type
Elm
37
star
16

elm-bash-completion

Bash completion for Elm
Shell
27
star
17

elm-init-scripts

Python
25
star
18

elm-fuse

Fuse support in Elm
Elm
24
star
19

elm-sketch-importer

Generate Elm code from Sketch files!
Elm
22
star
20

elm-proper-install

Properly install things from Github for Elm
JavaScript
16
star
21

make-your-own-tea

A step-by-step guide to making your own Elm architecture in TypeScript
Shell
15
star
22

coed

Elm-style library for writing modern frontends
TypeScript
15
star
23

neuro-lingo

A language where you only implement comments
TypeScript
13
star
24

elm-flat-matrix

Flat matrix implementation for Elm
Elm
12
star
25

elm-html-in-elm

Elm
12
star
26

elm-alternative-json

An alternative to core's JSON decoder
Elm
12
star
27

elm-xml

xml parser for elm
Elm
11
star
28

hiraeth

Shell
10
star
29

elm-lazy

Elm
10
star
30

elm-run-worker

Run Elm files in worker mode from the CLI
JavaScript
8
star
31

elm-dom-tests

Test dom things
JavaScript
8
star
32

elm-flasked

Elm
8
star
33

sass-to-elm

Elm
7
star
34

slack-today-i-did

Python
7
star
35

meta-elm

Examples of doing meta programming Elm, which you shouldn't do
Elm
7
star
36

elm-http-server

A HTTP server for Elm
Elm
7
star
37

elm-debug-json-view

A package for debugging a decoders with Json in Elm
Elm
6
star
38

stalk

stack-based language written in Elm
Elm
6
star
39

relm

Use react alongside elm
JavaScript
6
star
40

elm-help

JavaScript
6
star
41

elm-debug-decoders

A tool for debugging decoders
JavaScript
6
star
42

elm-package-for-production

Python
5
star
43

pycho

A game engine with inbuilt AI support written for Python 2 and 3.
Python
5
star
44

elm-node-elm-compiler

Elm compiler via Node
Elm
5
star
45

idris-hangman

Example of hangman in Idris
Idris
5
star
46

adeilad

Ensure JSON has the correct structure at runtime
TypeScript
4
star
47

elm-html-query

Elm
4
star
48

the-elm-report

A presentation on the state of Elm
JavaScript
4
star
49

elm-http-error-view

A generic view component
Elm
4
star
50

post-install-elm

Use NPM for managing elm deps
JavaScript
4
star
51

broken-clock

A broken clock used as examples for Elm
Elm
4
star
52

elm-macros

Python
3
star
53

elm-phoenixed

HTML
3
star
54

drawea

Elm
3
star
55

PyChat.js

A chat system built around graceful-websockets and tornado
JavaScript
3
star
56

elm-json-field-value

Elm
3
star
57

BigSister

Extendable IRC bot framework
Python
3
star
58

elm-test-runner

Python
3
star
59

elm-debounce-effects

An effect manager for dealing with debouncing
Elm
3
star
60

elm-query

JQuery for Elm
Elm
3
star
61

elm-diff

Elm
3
star
62

elm-stringify

DEPRECATED: no use
JavaScript
3
star
63

elm-game-of-games

Game of life in Elm
Elm
3
star
64

elm-shrink

Elm
2
star
65

elm-to-elixir

Elm
2
star
66

react-to-elm

Convert React components to Elm
2
star
67

elm-lint

Elm
2
star
68

fedora-matlab

Web challenge
2
star
69

PyGeo2

A project to continue maintaining PyGeo and bring it up to date
2
star
70

ts-core

Some core data structures and functions for typescript
TypeScript
2
star
71

code-golf

collection of code-golfs solutions from our code-golf club
Python
2
star
72

elm-lazy-list

Elm
2
star
73

talks

Various talks I've done
JavaScript
2
star
74

advent-of-code-2016

Idris
2
star
75

caching-layer-docker

Docker files for the elm caching layer
Shell
2
star
76

elm-default-dict

A dict implementation which allows you to provide a default value to use
Elm
1
star
77

SimpleGames

Simple games from Atari implemented in various languages.
Python
1
star
78

realrpg

Python
1
star
79

the-new-turing-omnibus

Elm
1
star
80

elm-uno

An Uno-to-x compiler written in Elm
Elm
1
star
81

mountain-path

Elm
1
star
82

ovas-2

C++
1
star
83

ts-list-zipper

TypeScript
1
star
84

relearn-yourself-a-java

A set of questions used to reteach Java to students.
Java
1
star
85

css-reactor

Elm
1
star
86

elm-safe-regex

JavaScript
1
star
87

Fuze

Elm
1
star
88

NetlogoSims

Simulations written using Netlogo
NetLogo
1
star
89

bach

TypeScript
1
star
90

newer-paper

Elm
1
star
91

ProcessingVisualizations

Python
1
star
92

elm-full-stack

1
star
93

baner

Flag parsing library in Typescript
TypeScript
1
star
94

fontbomber

A clone of https://github.com/code-curve/font-bomb, but written in Python
Python
1
star
95

SourceUploader

Simple uploader for files to gist
1
star
96

mainc

A simple, small benchmarking library for Node
TypeScript
1
star
97

LudumDare28

A game written for LudumDare28
Python
1
star
98

lets-write-elm

Elm
1
star
99

ArdLib

Arduino libraries and general programs with diagrams
1
star
100

elm-graphql-debug-errors

Elm
1
star