mirror of
https://github.com/gren-lang/compiler.git
synced 2024-08-16 12:00:22 +03:00
Setup hello world gren project.
This commit is contained in:
parent
726ee7c036
commit
9611b13d57
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,4 +3,7 @@ dist-newstyle
|
||||
cabal-dev
|
||||
.DS_Store
|
||||
*~
|
||||
.vscode
|
||||
.vscode
|
||||
.gren
|
||||
app
|
||||
index.js
|
||||
|
17
gren.json
Normal file
17
gren.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"type": "application",
|
||||
"platform": "node",
|
||||
"source-directories": [
|
||||
"src"
|
||||
],
|
||||
"gren-version": "0.3.0",
|
||||
"dependencies": {
|
||||
"direct": {
|
||||
"gren-lang/core": "local:../core",
|
||||
"gren-lang/node": "local:../node"
|
||||
},
|
||||
"indirect": {
|
||||
"gren-lang/url": "3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
35
package.json
Normal file
35
package.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "gren-lang",
|
||||
"version": "0.3.1",
|
||||
"description": "Compiler for the Gren programming language",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gren-lang/compiler.git"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"bin": {
|
||||
"gren": "index.js"
|
||||
},
|
||||
"keywords": [
|
||||
"gren",
|
||||
"lang",
|
||||
"language",
|
||||
"bin",
|
||||
"binary",
|
||||
"install",
|
||||
"installer"
|
||||
],
|
||||
"author": "Robin Heggelund Hansen",
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/gren-lang/compiler/issues"
|
||||
},
|
||||
"homepage": "https://gren-lang.org",
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
36
src/Main.gren
Normal file
36
src/Main.gren
Normal file
@ -0,0 +1,36 @@
|
||||
module Main exposing (main)
|
||||
|
||||
import Node
|
||||
import Init
|
||||
import Stream
|
||||
import Task
|
||||
|
||||
|
||||
main : Node.Program Model Msg
|
||||
main =
|
||||
Node.defineProgram
|
||||
{ init = init
|
||||
, update = update
|
||||
, subscriptions = always Sub.none
|
||||
}
|
||||
|
||||
|
||||
type alias Model = {}
|
||||
|
||||
|
||||
type Msg = None
|
||||
|
||||
|
||||
init : Node.Environment -> Init.Task { model : Model, command : Cmd Msg }
|
||||
init env =
|
||||
Node.startProgram
|
||||
{ model = {}
|
||||
, command = Task.execute <| Stream.sendLine env.stdout "Hello, World!"
|
||||
}
|
||||
|
||||
|
||||
update : Msg -> Model -> { model : Model, command : Cmd Msg }
|
||||
update msg model =
|
||||
{ model = model
|
||||
, command = Cmd.none
|
||||
}
|
Loading…
Reference in New Issue
Block a user