proj-oot-ootLibrariesNotes4

Difference between revision 13 and current revision

No diff available.

---

i guess we should at least have something like this:

https://github.com/zeit/micro

---

inglor 10 hours ago

> In order to maximize your usage of this feature, you'll want to use modules from the ecosystem that expose Promise instead of just a callback.

Bluebird which is one of the most popular promise libraries converts entire callback APIs to promises in one go:

Promise.promisifyAll(require("fs")); fs is now promisified and methods return promises.

(full disclosure, I'm a bluebird contributor)

reply

---

macros in js:

http://sweetjs.org/

---

some concurrency frameworks are suggested at the end of https://gist.github.com/staltz/868e7e9bc2a7b8c1f754

---

scala's pulsar concurrency framework

---

Without digging into it, the ((Elixir)) Calendar stuff looks like a strict improvement over Erlang's tuply handling of dates, times and timestamps, which are all tuples with three numbers. This can be confusing/problematic, and something that would benefit from typing to avoid mixing up Dates with Timestamps, say.

Can anyone who knows both confirm?

reply

antipax 1 hour ago

Yes, it absolutely is an improvement over erlang-style tuples IMO, and it also vastly improves the interoperability story between the stdlib, date/time/calendar libs, and database libs.

reply

"

Elixir Logo

    Home
    Install
    Getting Started
    Learning
    Docs
    Blog
    Packages

Elixir v1.3 released June 21, 2016 · by José Valim . in Releases

Elixir v1.3 brings many improvements to the language, the compiler and its tooling, specially Mix (Elixir’s build tool) and ExUnit? (Elixir’s test framework). The most notable additions are the new Calendar types, the new cross-reference checker in Mix, and the assertion diffing in ExUnit?. We will explore all of them and a couple more enhancements below.

With this release, we also welcome Andrea Leopardi to Elixir Core Team. He has contributed greatly to this release and maintains important packages in the community, like Gettext and Redix. Language improvements

The language has been improved semantically and includes new types and APIs. Let’s see the three major features. Deprecation of imperative assignment

Elixir will now warn if constructs like if, case and friends assign to a variable that is accessed in an outer scope. As an example, imagine a function called format that receives a message and some options and it must return a path alongside the message:

def format(message, opts) do path = if (file = opts) && (line = opts) do relative = Path.relative_to_cwd(file) message = Exception.format_file_line(relative, line) <> " " <> message relative end

  {path, message}end

The if block above is implicitly changing the value in message. Now imagine we want to move the if block to its own function to clean up the implementation:

def format(message, opts) do path = with_file_and_line(message, opts) {path, message} end

defp with_file_and_line(message, opts) do if (file = opts) && (line = opts) do relative = Path.relative_to_cwd(file) message = Exception.format_file_line(relative, line) <> " " <> message relative end end

The refactored version is broken because the if block was actually returning two values, the relative path and the new message. Elixir v1.3 will warn on such cases, forcing both variables to be explicitly returned from if, case and other constructs. Furthermore, this change gives us the opportunity to unify the language scoping rules in future releases. Calendar types and sigils

Elixir v1.3 introduces the Calendar module as well as 4 new calendar types:

    Date - used to store dates (year, month, day) in a given calendar
    Time - used to store time (hour, minute, second, microseconds)
    NaiveDateTime - used to store datetimes without a timezone (year, month, day, hour, minute, second, microseconds) in a given calendar. It is called naïve because without a timezone, the datetime may not actually exist. For example, when there are daylight savings changes, a whole hour may not exist (when the clock moves forward) or a particular instant may happen twice (when the clock moves backwards)
    DateTime - used to store datetimes with timezone (year, month, day, hour, minute, second, microsecond and time zone, with abbreviation, UTC and standard offset)

The current Calendar modules and its types is to provide a base for interoperatibility in the ecosystem instead of full-featured datetime API. This release includes basic functionality for building new types and converting them from and back strings.

Elixir v1.3 also introduces 3 new sigils related to the types above:

    ~D[2016-05-29] - builds a new date
    ~T[08:00:00] and ~T[08:00:00.285] - builds a new time (with different precisions)
    ~N[2016-05-29 08:00:00] - builds a naive da"

---

http://stackoverflow.com/questions/15995/useful-code-which-uses-reduce-in-python/282206#282206

---

i hear great things about the Scala collections library

also the operations in the LINQ section of Self:proj-plbook-plChData