From f70130322cd306268c5da12c1517dc5725615ae8 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 15 Feb 2024 12:18:17 +0000 Subject: text -> en --- .../lesson05_multi_target_externals/en.html | 22 ++++++++++++++++++++++ .../lesson05_multi_target_externals/text.html | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 src/content/chapter5_advanced_features/lesson05_multi_target_externals/en.html delete mode 100644 src/content/chapter5_advanced_features/lesson05_multi_target_externals/text.html (limited to 'src/content/chapter5_advanced_features/lesson05_multi_target_externals') diff --git a/src/content/chapter5_advanced_features/lesson05_multi_target_externals/en.html b/src/content/chapter5_advanced_features/lesson05_multi_target_externals/en.html new file mode 100644 index 0000000..6e02d36 --- /dev/null +++ b/src/content/chapter5_advanced_features/lesson05_multi_target_externals/en.html @@ -0,0 +1,22 @@ +

+ Multiple external implementations can be specified for the same function, + enabling the function to work on both Erlang and JavaScript. +

+

+ If a function doesn't have an implementation for the currently compiled-for + target then the compiler will return an error. +

+

+ You should try to implement functions for all targets, but this isn't always + possible due to incompatibilities in how IO and concurreny works in Erlang and + JavaScript. With Erlang concurrent IO is handled transparently by the runtime, + while in JavaScript concurrent IO requires the use of promises or callbacks. + If your code uses the Erlang style it is typically not possible to implement + in JavaScript, while if callbacks are used then it won't be compatible with + most Gleam and Erlang code as it forces any code that calls the function to + also use callbacks. +

+

+ Libraries that make use of concurrent IO will typically have to decide whether + they support Erlang or JavaScript, and document this in their README. +

diff --git a/src/content/chapter5_advanced_features/lesson05_multi_target_externals/text.html b/src/content/chapter5_advanced_features/lesson05_multi_target_externals/text.html deleted file mode 100644 index 6e02d36..0000000 --- a/src/content/chapter5_advanced_features/lesson05_multi_target_externals/text.html +++ /dev/null @@ -1,22 +0,0 @@ -

- Multiple external implementations can be specified for the same function, - enabling the function to work on both Erlang and JavaScript. -

-

- If a function doesn't have an implementation for the currently compiled-for - target then the compiler will return an error. -

-

- You should try to implement functions for all targets, but this isn't always - possible due to incompatibilities in how IO and concurreny works in Erlang and - JavaScript. With Erlang concurrent IO is handled transparently by the runtime, - while in JavaScript concurrent IO requires the use of promises or callbacks. - If your code uses the Erlang style it is typically not possible to implement - in JavaScript, while if callbacks are used then it won't be compatible with - most Gleam and Erlang code as it forces any code that calls the function to - also use callbacks. -

-

- Libraries that make use of concurrent IO will typically have to decide whether - they support Erlang or JavaScript, and document this in their README. -

-- cgit v1.2.3