Commit Graph

4638 Commits

Author SHA1 Message Date
Erik Svedang
b5d0a442fb fix: Just copy all the files in docs, for now 2020-11-19 20:29:09 +01:00
Erik Svedang
b3442bae5c fix: Subfolder? 2020-11-19 20:20:17 +01:00
Erik Svedang
6c523cf8ab fix: Wrong secret 2020-11-19 20:09:23 +01:00
Erik Svedang
ff8afed34b fix: Kebab case 2020-11-19 19:55:13 +01:00
Erik Svedäng
1ef7eac3d6
Merge pull request #979 from carp-lang/new-copy-script
fix: Trying out another copying script (temporarily removed the tests)
2020-11-19 19:48:51 +01:00
Erik Svedang
a48eb9ac9c Merge branch 'master' into new-copy-script 2020-11-19 19:48:06 +01:00
Erik Svedang
f099b5ef78 fix: Trying out another copying script (temporarily removed the tests) 2020-11-19 19:44:39 +01:00
Erik Svedang
637b66c88c fix: Trying out another copying script (temporarily removed the tests) 2020-11-19 19:43:03 +01:00
Erik Svedäng
19b609947f
Merge pull request #978 from TimDeve/simplify-macos-ci
Simplifies MacOS CI by removing custom version in setup-haskell
2020-11-19 10:03:33 +01:00
Tim Dévé
97100fb0bf Simplifies MacOS CI by removing custom version in setup-haskell 2020-11-19 08:38:34 +00:00
Erik Svedäng
b7455dc4d5
Merge pull request #977 from jacereda/nixpkgsci
Attempt to run CI jobs using Nixpkgs.
2020-11-19 08:43:09 +01:00
Jorge Acereda
0675bd6750 Attempt to run CI jobs using Nixpkgs. 2020-11-18 23:47:09 +01:00
Erik Svedang
7e5f97c30f fix: Trying random things 2020-11-18 23:40:19 +01:00
Erik Svedang
c5dacdeed9 fix: Once more, with feeling 2020-11-18 23:28:47 +01:00
Erik Svedäng
dd84fb320e
Merge pull request #976 from jacereda/rmshellnix
Remove shell.nix.
2020-11-18 23:19:52 +01:00
Erik Svedäng
08d998ede5 fix: Reverting to old config of the copy action to see if that helps 2020-11-18 23:03:18 +01:00
Erik Svedäng
f3eebf1aba docs: Try adding some docs to retrigger github action 2020-11-18 22:53:13 +01:00
Erik Svedäng
d50c14850c fix: Try some debug logging 2020-11-18 22:40:56 +01:00
Erik Svedäng
428dce9445 fix: Use 'sh' syntax in run_carp_tests.sh 2020-11-18 22:29:13 +01:00
Jorge Acereda
e3448ad250 Remove shell.nix. 2020-11-18 22:23:24 +01:00
Erik Svedäng
e08a69c9aa fix: Update doc links 2020-11-18 22:12:19 +01:00
Erik Svedang
1f4302afeb fix: Neater commit message on carp-docs 2020-11-18 15:56:18 +01:00
Erik Svedang
93b1d97f69 fix: Remove auto-generated (core) docs 2020-11-18 09:34:38 +01:00
Erik Svedang
42e9eb20a4 fix: Move copy docs back to bottom 2020-11-18 09:33:17 +01:00
Erik Svedang
d145bab677 fix: Temporarily move copy docs action to top, for easier debugging 2020-11-18 09:29:49 +01:00
Erik Svedang
eb8cee00db feat: Copy docs to external repository 2020-11-18 00:04:43 +01:00
Erik Svedäng
2f302aa046
Merge pull request #973 from jacereda/fix-suffix
Fix suffix docs and implementation, simplify prefix.
2020-11-17 23:59:46 +01:00
Jorge Acereda
e4d4a345b8 Fix suffix docs and implementation, simplify prefix. 2020-11-17 23:42:03 +01:00
Erik Svedäng
4e943bd506
Merge pull request #942 from hellerve/veit/reseed
Call Random.reseed at program start
2020-11-17 22:29:58 +01:00
Erik Svedäng
264d59b056
Merge pull request #910 from scolsen/construcible-refs
Allow Refs in polymorphic constructor positions
2020-11-17 22:25:07 +01:00
Erik Svedäng
c4b7dc3483
Merge pull request #967 from scolsen/unit-members
Allow Unit to be used as a member type in deftypes
2020-11-17 22:09:47 +01:00
Erik Svedäng
3432dff074
Merge pull request #915 from scolsen/fix-set-typing
Fix set! typing and add type checks
2020-11-17 22:08:54 +01:00
scottolsen
912649dfeb Merge branch 'master' of https://github.com/carp-lang/Carp into fix-set-typing 2020-11-17 12:13:26 -05:00
scottolsen
5b0b18c2c2 InitialTypes: Add DefDynamic typing; make match exhaustive
Our initial type setting function didn't assign the Dynamic type to
DefDynamic forms; after this commit, it will. It also wasn't an
exhaustive match, leading to ugly non-exhaustive pattern match errors in
rare cases. This commit adds a clause to prevent that.
2020-11-17 12:11:44 -05:00
scottolsen
d5c56f8285 Eval,Obj: Add LetDef Obj and type check let bindings
This commit adds a new obj, `LetDef` which we use to give let bindings a
similar form to Def bindings and DefDynamic bindings. This enables us to
type check `set!` calls on let bindings just as we do def bindings and
defdynamic bindings.
2020-11-17 12:10:10 -05:00
Erik Svedäng
ea71ef910d
Merge pull request #971 from jacereda/fix-923
Fix crash reported in #923.
2020-11-17 07:12:04 +01:00
Jorge Acereda
2d91f49600 Fix crash reported in #923. 2020-11-16 23:46:16 +01:00
Erik Svedang
9629195a62 fix: Remove noisy ouput when getting an unrecognized form in Eval 2020-11-16 20:26:37 +01:00
scottolsen
e2308ddc6e Restore initialization of dummy in deftypes 2020-11-16 02:10:54 -05:00
scottolsen
ee53585606 Add note about catchall case in setStaticOrDynamicVar 2020-11-16 01:41:56 -05:00
scottolsen
0735fb7af8 Merge branch 'master' of https://github.com/carp-lang/Carp into fix-set-typing 2020-11-16 01:38:18 -05:00
scottolsen
99f54680ff Fix instantiation of empty structs
Now that we properly omit all member fields for Unit types, the C
structs we instantiate cannot initialize *any* fields, rendering the
zero-initialization syntax invalid. We use an empty struct instead.
2020-11-16 01:32:24 -05:00
scottolsen
143fafc12a Allow Unit to be used as a member type in deftypes
This commit enables support for using values of type () (Unit) in
user-defined types such as product and sumtypes. After this commit,
types such as:

    (deftype Units [action-one () action-two ()])

Are valid, and can be instantiated in the obvious way:

    (Units.init (IO.println "foo") ())

Some important things to note about the implementation:

- The C structs emitted for types containing Unit members *completely
  omit all unit members*. If a type in Carp has N members, the
  corresponding C struct will have (N-U) members where U is the number of
  members with the type `Unit`.

  For example, this type:

    (deftype (Foo [one Unit two Int]))

  will produce the following typedef in C:

    typedef struct {
      int two;
    } Foo;

  As a special case, types that *only* have Unit's as members are represented and
  initialized as completely empty structs:

    (deftype Foo [empty Unit])

    // emits

    typedef struct {
    } Foo;

    Foo Foo_init() {
      Foo instance = {};

      return instance;
    }

   Such a type is merely a container for side effects.

- Side effects are not stored at all in the types that contain Unit
  members. Instead, any side effects will be lifted out of the emitted C
  struct and called prior to initialization.

  For example, initializing `(deftype Foo [empty Unit])` with `(Foo.init
  (IO.println "foo"))` will produce the following C:

    main(...) {
      //...
      static String _10 = "foo";
      String *_10_ref = &_10;
      IO_println(_10_ref);
      Foo _12 = Foo_init();
      //...
    }

- The typical operations on product fields are supported on Unit type
  members, but they have slightly custom semantics. Since we don't
  actually store any values of type Unit in custom types, most
  updaters/getters/setters simply run a side effect.

  This is mostly only supported to make the use of such members more
  intuitive and allow programmers to chain side-effects within some
  context, much like monadic IO in Haskell.

- Match forms also work on Unit types for parity, but again, there is no
  meaningful behavior here, since Unit only has a single type
  inhabitant.

As a bonus, this commit also makes it possible to use `Unit` and `()`
interchangeably in type signatures.
2020-11-16 01:06:44 -05:00
Erik Svedang
0faf8641e6 Update version number on front page 2020-11-15 21:59:53 +01:00
Erik Svedang
d86a0d4b0d Try single '=' 2020-11-15 21:46:25 +01:00
Erik Svedang
3d8e173f09 Try bash instead 2020-11-15 21:38:32 +01:00
Erik Svedang
232ba9d9b1 Better bash in release.sh 2020-11-15 21:35:52 +01:00
Erik Svedang
1d14e2d995 Need quotes around the name. 2020-11-15 21:18:01 +01:00
Erik Svedang
1b508cf56e Remove suffix from release name 2020-11-15 21:13:54 +01:00
Erik Svedang
5da3fd8126 Probably need the name here too 2020-11-15 21:01:29 +01:00