Skip to content

Commit 8c7772d

Browse files
committed
Remove references to processes
1 parent 924c61e commit 8c7772d

File tree

11 files changed

+14
-348
lines changed

11 files changed

+14
-348
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Updated `for` implementation to use Collectable
1212
- `format` option. Can now specify the module format of output. Choices are `es` (default), `umd`, or `common`
1313

14+
### Removed
15+
- `receive`
16+
- `Process` module
17+
1418
### Fixed
1519
- JS module functions not translated properly when imported
1620
- Update fs dependency to 2.12

FAQ.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The compiler to this point has been focused on translating Kernel.SpecialForms a
4141

4242
* Missing
4343
* `super(args)`
44+
* `receive`
4445

4546
* Caveats
4647
* `quote` - ignores `context` options
@@ -50,7 +51,6 @@ The compiler to this point has been focused on translating Kernel.SpecialForms a
5051

5152
1 = a # may not work currently, but in some cases it will
5253
```
53-
* `send` and `receive` only work on functions defined with `defgen` or `defgenp`
5454

5555

5656
#### Completed Modules
@@ -91,8 +91,8 @@ You **can** use ElixirScript on your front ends and have it work and interoperat
9191

9292
## Q. Can I use processes?
9393

94-
### A. Yes, with some caveats as mentioned above. Only current works with functions defined with `defgen` or `defgenp`
94+
### A. ElixirScript does not support processes
9595

9696
## Q. What about OTP?
9797

98-
### A. Not yet. Maybe never.
98+
### A. ElixirScript does not support OTP

lib/elixir_script/prelude/kernel.ex

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -159,42 +159,6 @@ defmodule ElixirScript.Kernel do
159159
term === nil
160160
end
161161

162-
def make_ref() do
163-
Elixir.Core.processes.make_ref()
164-
end
165-
166-
def spawn(gen) do
167-
Elixir.Core.processes.spawn(gen)
168-
end
169-
170-
def spawn(module, fun, args) do
171-
Elixir.Core.processes.spawn(module, Atom.to_string(fun), args)
172-
end
173-
174-
def spawn_link(gen) do
175-
Elixir.Core.processes.spawn_link(gen)
176-
end
177-
178-
def spawn_link(module, fun, args) do
179-
Elixir.Core.processes.spawn_link(module, Atom.to_string(fun), args)
180-
end
181-
182-
def spawn_monitor(gen) do
183-
Elixir.Core.processes.spawn_monitor(gen)
184-
end
185-
186-
def spawn_monitor(module, fun, args) do
187-
Elixir.Core.processes.spawn_monitor(module, Atom.to_string(fun), args)
188-
end
189-
190-
def send(pid, message) do
191-
Elixir.Core.processes.send(pid, message)
192-
end
193-
194-
def self() do
195-
Elixir.Core.processes.pid()
196-
end
197-
198162
defmacro sigil_r({:<<>>, _meta, [string]}, options) do
199163
str_options = List.to_string(options)
200164
quote do

lib/elixir_script/prelude/process.ex

Lines changed: 0 additions & 90 deletions
This file was deleted.

lib/elixir_script/translator.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ defmodule ElixirScript.Translator do
2424
alias ElixirScript.Translator.JS, as: JSLib
2525
alias ESTree.Tools.Builder, as: JS
2626
alias ElixirScript.Translator.Rewriter
27-
alias ElixirScript.Translator.Receive
2827

2928
# A list of erlang modules. These are rewritten into equivalent
3029
# JavaScript functions using ElixirScript.Translator.Rewriter
@@ -460,8 +459,8 @@ defmodule ElixirScript.Translator do
460459
Function.make_anonymous_function(clauses, env)
461460
end
462461

463-
defp do_translate({:receive, _, [expressions] }, env) do
464-
Receive.make_receive(expressions, env)
462+
defp do_translate({:receive, _, _ }, _) do
463+
raise ElixirScript.Translator.UnsupportedError, "receive"
465464
end
466465

467466
defp do_translate({:{}, _, elements}, env) do

lib/elixir_script/translator/kernel/special_forms/receive.ex

Lines changed: 0 additions & 68 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"license": "MIT",
2525
"dependencies": {
2626
"erlang-types": "^1.0.0",
27-
"erlang-processes": "^2.0.0",
2827
"tailored": "2.3.2"
2928
},
3029
"devDependencies": {

src/javascript/lib/core.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import Processes from 'erlang-processes';
2-
import Patterns from 'tailored';
3-
import ErlangTypes from 'erlang-types';
4-
import Functions from './core/functions';
5-
import SpecialForms from './core/special_forms';
6-
import Store from './core/store';
7-
8-
let processes = new Processes.ProcessSystem();
1+
import Patterns from "tailored";
2+
import ErlangTypes from "erlang-types";
3+
import Functions from "./core/functions";
4+
import SpecialForms from "./core/special_forms";
5+
import Store from "./core/store";
96

107
class Integer {}
118
class Float {}
129

1310
export default {
14-
ProcessSystem: Processes.ProcessSystem,
15-
processes: processes,
1611
Tuple: ErlangTypes.Tuple,
1712
PID: ErlangTypes.PID,
1813
BitString: ErlangTypes.BitString,

test/translator/kernel/receive_test.exs

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)