Skip to content

Commit

Permalink
Merge luna-core into luna.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrecursion committed Aug 10, 2018
2 parents d256164 + 3ec1e35 commit c1e52b1
Show file tree
Hide file tree
Showing 440 changed files with 44,093 additions and 3,845 deletions.
24 changes: 24 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,24 @@
version: 2
jobs:
luna-compiler:
environment:
GHC_RTS: -M3G
docker:
- image: lunalang/luna-core-ci:1.0
steps:
- checkout
- restore-cache:
keys: stack-v1
- run: stack setup
- run: stack build -j1 --fast --ghc-options="-pgmc gcc-7" --test
- save-cache:
key: stack-v1
paths:
- "~/.stack"
- ".stack-work"

workflows:
version: 2
percommit:
jobs:
- luna-compiler
34 changes: 33 additions & 1 deletion .gitignore
Expand Up @@ -21,7 +21,6 @@ cabal.sandbox.config
*.DS_Store
.stack-work/


############
## Python ##
############
Expand Down Expand Up @@ -108,3 +107,36 @@ build/dist/
build/.stack-work/
bin/luna
myproj
=======
# hlint
report.html



############
## System ##
############

# OSX
.DS_Store



#############
## Editors ##
#############

# Vim
*.swp
*.projections.json



############
## Images ##
############

*.jpg
*.jpeg
*.png

79 changes: 79 additions & 0 deletions .hlint.yaml
@@ -0,0 +1,79 @@
#####################################################################
# HLint configuration file
# https://github.com/ndmitchell/hlint
#####################################################################


#####################################################################
## DISABLED LINTS

- ignore: {name: "Parse error"}
- ignore: {name: "Redundant lambda"}


#####################################################################
## RESTRICTIONS

- extensions:
- default: false
- name: [ AllowAmbiguousTypes
, ApplicativeDo
, BangPatterns
, BinaryLiterals
, ConstraintKinds
, DataKinds
, DefaultSignatures
, DeriveDataTypeable
, DeriveFoldable
, DeriveFunctor
, DeriveGeneric
, DeriveTraversable
, DoAndIfThenElse
, DuplicateRecordFields
, EmptyDataDecls
, FlexibleContexts
, FlexibleInstances
, ForeignFunctionInterface
, FunctionalDependencies
, GeneralizedNewtypeDeriving
, InstanceSigs
, LambdaCase
, MonadComprehensions
, MonadFailDesugaring
, MultiWayIf
, NamedWildCards
, NegativeLiterals
, NoImplicitPrelude
, NumDecimals
, OverloadedLabels
, OverloadedLists
, OverloadedStrings
, PackageImports
, PolyKinds
, QuasiQuotes
, PatternSynonyms
, RankNTypes
, RecursiveDo
, ScopedTypeVariables
, StandaloneDeriving
, TemplateHaskell
, TupleSections
, TypeApplications
, TypeFamilies
, TypeFamilyDependencies
, TypeInType
, TypeOperators
, UndecidableInstances
, UnliftedFFITypes
, UnicodeSyntax
, ViewPatterns
, LiberalTypeSynonyms
, RelaxedPolyRec
]


#####################################################################
## OTHER HINTS

- group: {name: dollar, enabled: true}
- group: {name: generalise, enabled: true}
35 changes: 30 additions & 5 deletions .stylish-haskell.yaml
Expand Up @@ -13,12 +13,33 @@ steps:

- records: {}

- simple_align:
cases : true
top_level_patterns : true
records : true

- imports:
align : group
list_align : after_alias
pad_module_names : true
long_list_align : inline
empty_list_align : inherit
list_padding : 4
separate_lists : true
space_surround : false

- language_pragmas:
style : vertical
align : true
remove_redundant : false

- tabs:
spaces: 4

- trailing_whitespace: {}

columns: 200
columns: 80
newline: native

language_extensions:
- AllowAmbiguousTypes
Expand All @@ -37,14 +58,16 @@ language_extensions:
- DoAndIfThenElse
- DuplicateRecordFields
- EmptyDataDecls
- ExplicitNamespaces
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GeneralizedNewtypeDeriving
- InstanceSigs
- LambdaCase
- LiberalTypeSynonyms
- MonadComprehensions
# - MonadFailDesugaring
- MultiParamTypeClasses
- MultiWayIf
- NamedWildCards
- NegativeLiterals
Expand All @@ -53,8 +76,12 @@ language_extensions:
- OverloadedLabels
- OverloadedStrings
- PackageImports
- PatternSynonyms
- PolyKinds
- QuasiQuotes
- RankNTypes
- RecursiveDo
- RelaxedPolyRec
- ScopedTypeVariables
- StandaloneDeriving
- TemplateHaskell
Expand All @@ -63,8 +90,6 @@ language_extensions:
- TypeFamilies
- TypeFamilyDependencies
- TypeOperators
- UnicodeSyntax
- ViewPatterns

- LiberalTypeSynonyms
- RelaxedPolyRecs
- MultiParamTypeClasses
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Expand Up @@ -37,7 +37,7 @@ These are the policies for upholding our community's standards of conduct. If
you feel that a thread needs moderation, please contact the
[Luna moderation team][mod_team].

1. Remarks that violate the Rust standards of conduct, including hateful,
1. Remarks that violate the Luna standards of conduct, including hateful,
hurtful, oppressive, or exclusionary remarks, are not allowed. Cursing is
allowed, but never targeting another user, and never in a hateful manner.
2. Remarks that moderators find inappropriate, whether listed in the code of
Expand Down
40 changes: 19 additions & 21 deletions CONTRIBUTING.md
Expand Up @@ -133,11 +133,12 @@ Where `<component>` is one of the following:

- `luna-core` (found in `$LUNA_REPO_PATH/core`)
- `lune-passes` (found in `$LUNA_REPO_PATH/passes`)
- `luna-project` (found in `$LUNA_REPO_PATH/project`)
- `luna-package` (found in `$LUNA_REPO_PATH/package`)
- `luna-runtime` (found in `$LUNA_REPO_PATH/runtime`)
- `luna-shell` (found in `$LUNA_REPO_PATH/shell`)
- `luna-stdlib` (found in `$LUNA_REPO_PATH/stdlib`)
- `luna-lexer` (found in `$LUNA_REPO_PATH/syntax/text/lexer`)
- `luna-parser` (found in `$LUNA_REPO_PATH/syntax/text/parser`)
- `luna-syntax-text-lexer` (found in `$LUNA_REPO_PATH/syntax/text/lexer`)
- `luna-syntax-text-parser` (found in `$LUNA_REPO_PATH/syntax/text/parser`)

#### Developing with Local Libraries
If you are hacking on the libraries that Luna uses, you'll want to be building
Expand All @@ -157,30 +158,27 @@ stack build --stack-yaml build/stack-local.yaml
```

### Running Luna
As a prerequisite, you need to set a `LUNA_LIBS_PATH` variable to point to the
As a prerequisite, you need to set a `LUNA_HOME` variable to point to the
location of the Luna standard library. Assuming your repo is at
`$LUNA_REPO_PATH`, you will need to set `LUNA_LIBS_PATH` to `$LUNA_REPO_PATH/stdlib`.
`$LUNA_REPO_PATH`, you will need to set `LUNA_HOME` to `$LUNA_REPO_PATH/stdlib`.

Next, you need to create the project: create a directory structure like this:
Next, you need to create the project. This is as simple as executing
`luna init <project-path>`, which will create a project in the directory
specified with the correct structure. It will create a defaulted `Main.luna`
file for you as well, allowing you to immediately execute this.

```
your_project/
┖─ src/
┠─ Main.luna
┖─ any other *.luna files
```
A sample `Main.luna` file may look like this:
To interpret and run the project, simply type `luna run` in the main project
directory. Alternatively, you can pass the project directory explicitly as
follows:

```python
import Std.Base

def main:
print "Hello world"
print (2 + 2)
```
luna exec --target path/to/MyProject
```

To compile and run the project, simply type `luna` in the main project
directory.
#### Executing Luna on Standalone Files
The Luna interpreter is also capable of executing standalone Luna files. This
can be done by passing a luna source file to the `--target` flag, similarly to
the above.

## Pull Requests
Pull Requests are the primary method for making changes to Luna. GitHub has
Expand Down
40 changes: 19 additions & 21 deletions README.md
Expand Up @@ -92,11 +92,12 @@ Where `<component>` is one of the following:

- `luna-core` (found in `$LUNA_REPO_PATH/core`)
- `lune-passes` (found in `$LUNA_REPO_PATH/passes`)
- `luna-project` (found in `$LUNA_REPO_PATH/project`)
- `luna-package` (found in `$LUNA_REPO_PATH/package`)
- `luna-runtime` (found in `$LUNA_REPO_PATH/runtime`)
- `luna-shell` (found in `$LUNA_REPO_PATH/shell`)
- `luna-stdlib` (found in `$LUNA_REPO_PATH/stdlib`)
- `luna-lexer` (found in `$LUNA_REPO_PATH/syntax/text/lexer`)
- `luna-parser` (found in `$LUNA_REPO_PATH/syntax/text/parser`)
- `luna-syntax-text-lexer` (found in `$LUNA_REPO_PATH/syntax/text/lexer`)
- `luna-syntax-text-parser` (found in `$LUNA_REPO_PATH/syntax/text/parser`)

#### Developing with Local Libraries
If you are hacking on the libraries that Luna uses, you'll want to be building
Expand All @@ -116,30 +117,27 @@ stack build --stack-yaml build/stack-local.yaml
```

### Running Luna
As a prerequisite, you need to set a `LUNA_LIBS_PATH` variable to point to the
As a prerequisite, you need to set a `LUNA_HOME` variable to point to the
location of the Luna standard library. Assuming your repo is at
`$LUNA_REPO_PATH`, you will need to set `LUNA_LIBS_PATH` to `$LUNA_REPO_PATH/stdlib`.
`$LUNA_REPO_PATH`, you will need to set `LUNA_HOME` to `$LUNA_REPO_PATH/stdlib`.

Next, you need to create the project: create a directory structure like this:
Next, you need to create the project. This is as simple as executing
`luna init <project-path>`, which will create a project in the directory
specified with the correct structure. It will create a defaulted `Main.luna`
file for you as well, allowing you to immediately execute this.

```
your_project/
┖─ src/
┠─ Main.luna
┖─ any other *.luna files
```
A sample `Main.luna` file may look like this:
To interpret and run the project, simply type `luna run` in the main project
directory. Alternatively, you can pass the project directory explicitly as
follows:

```python
import Std.Base

def main:
print "Hello world"
print (2 + 2)
```
luna exec --target path/to/MyProject
```

To compile and run the project, simply type `luna` in the main project
directory.
#### Executing Luna on Standalone Files
The Luna interpreter is also capable of executing standalone Luna files. This
can be done by passing a luna source file to the `--target` flag, similarly to
the above.

## Contributing to Luna
If you are interested in contributing to the development of Luna, please read
Expand Down
7 changes: 7 additions & 0 deletions config/snapshot-local.yaml
@@ -0,0 +1,7 @@
resolver: nightly-2018-05-30
name: luna-local
packages:
- hspec-expectations-lifted-0.10.0
- megaparsec-6.5.0
- placeholders-0.1

22 changes: 22 additions & 0 deletions config/snapshot.yaml
@@ -0,0 +1,22 @@
resolver: nightly-2018-05-30
name: luna
packages:
- megaparsec-6.5.0
- layered-state-1.1.4
- convert-1.5
- typelevel-1.2.2
- container-1.1.1
- layouting-1.1.3
- monoid-0.1.8
- vector-text-1.1.3
- lens-utils-1.4.5
- hspec-expectations-lifted-0.10.0
- monad-branch-1.0.3
- prologue-3.2.3
- functor-utils-1.17.1
- impossible-1.1.3
- placeholders-0.1
- terminal-text-1.1.1
- git: "git@github.com:fpco/weigh.git"
commit: aabc37b4a4d9cc2fed236714e345394a60a18310

0 comments on commit c1e52b1

Please sign in to comment.