You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update build history; note spago difference
* Add initial explanation for VTAs
* Fix monad state instantiation
* Fix Effect example
* Link to falsify and other prop test links
* Link to Free Boolean Cube
* fp-ts' migration guide
* Add GADT-related link
* Fix file name
* Update spago/purs to latest
Copy file name to clipboardExpand all lines: 01-Getting-Started/01-Why-Learn-PureScript.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,7 @@ One of the main issues with JavaScript is a poor type system. Many errors aren't
65
65
66
66
TypeScript seems to address this type safety issue. Just consider its name! However, a few people who are using PureScript now have said this about TypeScript: "You might as well be writing Javascript." TypeScript does not provide any real guarantees; it only pretends. PureScript does provide such guarantees.
67
67
68
+
-[`fp-ts`'s Migration guide from PureScript to TypeScript](https://gcanti.github.io/fp-ts/guides/purescript.html). This is helpful for seeing 1) how much more TypeScript code it takes to implement the same feature in PureScript, and 2) how the resulting syntax IMO is of lesser quality and clarity than the corresponding PureScript code is.
68
69
-[TypeScript vs PureScript: Not All Compilers Are Created Equal](https://blog.logrocket.com/typescript-vs-purescript-not-all-compilers-are-created-equal-c16dadaa7d3e)
69
70
-[JavaScript, TypeScript, and PureScript](https://www.youtube.com/watch?v=JTEfpNtEoSA) or "Why TypeScript only 'pretends' to have types."
70
71
-[Various examples comparing PureScript and TypeScript](https://discourse.purescript.org/t/type-system-showdown-purescript-and-typescript/2084)
Copy file name to clipboardExpand all lines: 03-Build-Tools/Readme.md
+29-18Lines changed: 29 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,11 @@ This folder accomplishes the following:
10
10
11
11
## History: How We Got Here
12
12
13
-
The following explanation does not cover all the tools used in PureScript's ecosystem. However it provides context for later files. In short, `spago` is both the official dependency manager and build tool. `bower` can be thought of as a deprecated dependency manager; the community is in the process of building a registry that will replace the Bower registry since it no longer accepts uploads. `pulp` is a build tool that uses `bower`; its usage will become more common again once the registry is built.
13
+
The following explanation does not cover all the tools used in PureScript's ecosystem. However it provides context for later files.
14
+
15
+
In short, `spago` is both the official dependency manager and build tool. It was originally written in Haskell. It's currently being rewritten in PureScript. The Haskell version is called `spago-legacy` whereas the rewrite is the alpha `spago`. Whenever this repo mentions `spago`, it's always in reference to `spago-legacy`.
16
+
17
+
There are two other tools that are only around because alpha `spago` hasn't been finished yet. `bower` can be thought of as a deprecated dependency manager; the community used this tool because it provided a registry. `pulp` is a build tool that uses `bower`; its usage has become less frequent because of the migration towards `spago`.
14
18
15
19
### Phase 1: Initial Tooling
16
20
@@ -24,6 +28,8 @@ Bodil Stokke (with later contributions from Harry Garrood) later wrote a tool ca
24
28
- publish libraries and their docs
25
29
- easily bump the project's version
26
30
31
+
This is why most of the "core" libraries (PureScript libraries stored under the `purescript` GitHub organization) still have `bower.json` files as their dependencies.
32
+
27
33
### Phase 2: The `psc-package` Experiment
28
34
29
35
`Bower` worked fine, but there were a few user-interface issues that made it difficult to use, especially when a new PureScript release was made that included breaking changes.
@@ -40,38 +46,29 @@ See the below image to visualize this:
40
46
41
47
### Phase 3: Improving the `psc-package` Developer Workflow via `Spago`
42
48
43
-
From the above image, one should infer that using `pulp` and `bower` was overall easier to use and explain. Thus, Justin Woo and Fabrizo Ferrai started a project called `spago`. `spago` evolved out of `spacchetti` and reimplemented parts of `psc-package` into one program with a seamless developer workflow. While `psc-package` can still be used, it's better to use `spago`.
49
+
From the above image, one should infer that using `pulp` and `bower` was overall easier to use and explain. Thus, Justin Woo and Fabrizo Ferrai started a project called `spago`. `spago` evolved out of `spacchetti` and reimplemented parts of `psc-package` into one program with a seamless developer workflow. While `psc-package` can still be used, it became better to use `spago`.
### Phase 4: `Spago` becomes mainstream while `psc-package` is less used
50
56
51
-
Spago dropped support for `psc-package` commands in the `v0.11.0` release. `psc-package`is still usable and is more or less feature-complete. However, no further work on it will be done. Rather, Spago has become the main dependency manager when utilizing package-sets.
57
+
Spago dropped support for `psc-package` commands in the `v0.11.0` release. `psc-package`was still usable and was more or less feature-complete. However, no further work was being done on it. Rather, Spago had become the main dependency manager when utilizing package-sets.
52
58
53
-
The community is now split between `pulp` + `bower` workflows and`spago` workflows. One must still use `pulp` + `bower` if they want to do the following:
59
+
At this point, part of the community used `pulp` + `bower` workflows while the rest used`spago` workflows. One must still use `pulp` + `bower` if they want to do the following:
54
60
- publish their library's docs to Pursuit
55
61
- include their library in a package set, so `spago` users can use it
56
62
57
63
### Phase 5: The need for a PureScript registry (Bower registry no longer accepts new uploads)
58
64
59
65
The Bower registry stopped accepting new uploads. The community quickly updated their tooling to workaround how libraries are published and installed. However, it was clear that PureScript now needed to create a registry.
60
66
61
-
Fabrizio Ferrai led the effort to build this registry with significant input from Harry Garrood. The registry is not yet complete, so the community is in this in-between stage.
62
-
63
-
Regardless, the following is still true:
64
-
- most people are now using `spago`
65
-
- the `pulp` + `bower` workflow is still needed to publish a library, but it works differently now.
66
-
- See [these instructions for how to use `bower` to publish a library in this in-between context](https://discourse.purescript.org/t/up-to-date-instructions-for-publishing-new-packages/1953)
67
-
- See the `Dependency Managers/Bower Explained` file for clarification on how to install packages as dependencies if one is using `bower`
68
-
- Thomas has written a [Recommended Tooling for PureScript Applications](https://discourse.purescript.org/t/recommended-tooling-for-purescript-applications-in-2019/948) post.
69
-
70
-
See [The `bower` registry is no longer accepting package submissions](https://discourse.purescript.org/t/the-bower-registry-is-no-longer-accepting-package-submissions/1103/) for more context.
67
+
Fabrizio Ferrai led the effort to build this registry with significant input from Harry Garrood. The registry is not yet complete, so the community is in this in-between stage. See [The `bower` registry is no longer accepting package submissions](https://discourse.purescript.org/t/the-bower-registry-is-no-longer-accepting-package-submissions/1103/) for more context.
71
68
72
69
### Phase 6: Updating JavaScript output to ES modules and delegating bundling to 3rd-party tools
73
70
74
-
In PureScript `0.15.0`, we stopped compiling PureScript source code to CommonJS modules and started compiling to ES modules. As a result, we dropped the buggy and broken bundler provided via `purs bundle` and instead directed endusers to use 3rd-party bundlers like `esbuild`, `webpack`, and `parecel`. Such bundlers often produced smaller bundles than `purs bundle`. Moreover, it gave the core team in charge of PureScript one less thing to maintain.
71
+
In PureScript `0.15.0`, we stopped compiling PureScript source code to CommonJS modules and started compiling to ES modules. As a result, we dropped the buggy and broken bundler provided via `purs bundle` and instead directed end-users to use 3rd-party bundlers like `esbuild`, `webpack`, and `parcel`. Such bundlers often produced smaller bundles than `purs bundle`. Moreover, it gave the core team in charge of PureScript one less thing to maintain.
75
72
76
73
See the [0.15.0 Migration Guide](https://github.com/purescript/documentation/blob/master/migration-guides/0.15-Migration-Guide.md) for more details.
77
74
@@ -81,15 +78,29 @@ While the Purescript compiler produces correct JavaScript code, there were a num
81
78
82
79
Soon after the time that PureScript `0.15.4` was released, a new project called `purs-backend-es` was released. This project works on the `CoreFn` representation and transforms it to JavaScript. However, it also optimizes the code significantly during this tranformation. For a few example, see [the `purs` and `purs-backend-es` comparison table in its README](https://github.com/aristanetworks/purescript-backend-optimizer#overview).
83
80
84
-
While this tool's main purpose is to produce optimized JavaScript code, it enables others to produce new backends. A backend is a target language to which PureScript can be compiled. Before this tool, every backend had to reinvent a lot of code to make it work for that language. With the underlying library, `purescript-backend-optimizer`, one can more easily produce a new backend.
81
+
While this tool's main purpose is to produce optimized JavaScript code, it enables others to produce new backends more easily. A backend is a target language to which PureScript can be compiled. Before this tool, every backend had to reinvent a lot of code to make it work for that language. With the underlying library, `purescript-backend-optimizer`, one can more easily produce a new backend.
82
+
83
+
### Phase 8: The Registry and the Spago Rewrite
84
+
85
+
The Registry's speed of development was lackluster for quite some time. Fortunately, Thomas Honeyman made it a personal goal to see the Registry implemented. Since then, the Registry's development picked up and eventually became useable, although it's still not yet finished.
86
+
87
+
More recently, Fabrizio decided to rewrite Spago in PureScript. The main advantage of doing this was the ability to leverage the Registry codebase within Spago, allowing for a more seamless publishing workflow among other things. Such work is still on-going as of this writing (Sept 2023). But, the version of Spago written in Haskell is now known as "Spago Legacy" and the version written in PureScript is "Spago Next" because one install spago next via `npm i spago@next`.
88
+
89
+
## Spago: Haskell Legacy codebase or PureScript rewrite codebase?
90
+
91
+
| Type | NPM Package | Versions | Install via | Alternative |
92
+
| - | - | - | - | - |
93
+
| Legacy Spago |`spago`|`0.0.1` - `0.21.0`|`npm i spago`|`npm i spago-legacy` (installs `[email protected]` under binary name `spago-legacy`) |
94
+
| Rewrite Spago |`spago`|`0.92.0` - `0.93.x`|`npm i spago@next`| - |
85
95
86
96
## Overview of Tools
87
97
88
98
| Name | Type/Usage | Comments | URL |
89
99
| - | - | - | - |
90
100
| purs | PureScript Compiler | Used to be called `psc`| -- |
91
-
| spago | Build Tool | Front-end to `purs` and `package-set`-based projects | https://github.com/purescript/spago
0 commit comments