Setup hello world gren project.

This commit is contained in:
Robin Heggelund Hansen 2024-06-02 20:57:15 +02:00
parent 726ee7c036
commit 9611b13d57
No known key found for this signature in database
4 changed files with 92 additions and 1 deletions

5
.gitignore vendored
View File

@ -3,4 +3,7 @@ dist-newstyle
cabal-dev
.DS_Store
*~
.vscode
.vscode
.gren
app
index.js

17
gren.json Normal file
View 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
View 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
View 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
}