Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

87 changes: 4 additions & 83 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,12 @@ SPDX-License-Identifier: Apache-2.0

Support fo scanning the Elixir ecosystem needs to be added.

* `audit` should seamlessly audit Elixir applications and libraries for AtomVM
compatibility.
* `ecosystem` command should have an --elixir (or --ex) option for creating an Elixir
ecosystem data-set.

### Change data structure for stored version info

The current version data is stored as a binary string for tags and branches,
this is brittle when comparing versions in the `update` command, and will cause
noticeable errors if any AtomVM release versions use double digits for major,
minor or patch levels. The storage format should be migrated to tuples.

#### Tagged releases

```erlang
{
Major :: non_neg_integer(),
Minor :: non_neg_integer(),
Patch :: non_neg_integer()
}
```

#### Branches

##### main

```erlang
{
unreleased,
main
}
```

##### `release-X.X`

```erlang
{
unreleased,
{release, Major :: non_neg_integer(), Minor :: non_neg_integer()}
}
```
* `filter` command needs to be updated to work on Elixir ecosystem data with an
--elixir (or --ex) option

## Should have

Expand All @@ -63,38 +30,6 @@ bare call like length(X) to resolve to the local function instead of the BIF,
but the code will still count it as an OTP call, misclassifying user-defined
functions and skewing scan results.

### `supported` modules

The `supported` command should print a list of all AtomVM modules if the `-m`
or `--module` option is given without a module name.

### Finer platform support tracking

The tracking of platform support is not perfect. Some modules, like `network`
end up being assigned too broad of platform support, in this case including
`generic_unix` in the supported platforms, due to modules being assigned by
library so all modules in `avm_network` are reported as supported by `esp32`,
`generic_unix`, and `rp2` platforms. The `network` module is not supported on
`generic_unix`, only `esp32` and `rp2`, but to track these exceptions specific
filtering rules will be needed.

The version added data should be tracked per-platform. For example `i2c` and
`spi` added support for `rp2` and `stm32` platforms in version 0.7.0, while
`esp32` had support in 0.5.0 and the `supported` command reports support for
all platforms, and reports 0.5.0 as the release these functions were introduced
(inaccurate for `rp2` and `stm32` platforms). The data storage format needs to
be altered to track support for each platform, with `all` only requiring a
single entry with the version.

#### Track when modules or functions are deprecated and removed

The supported functions data should track when modules are deprecated, and
also when they are removed. Some new data structure will need to be devised,
either a new field entirely, or expanding the `since` which will also be
holding platform specific release introductions. The deprecation and removal
releases may need to be hard-coded into the application, as these are rare, and
parsing doc strings could potentially lead to false positives.

### Add support for adding (and reporting) downstream drivers and libraries

The `update` command should have an option for adding downstream drivers or
Expand All @@ -108,20 +43,6 @@ supported functions as bare atoms, and downstream libraries as
AtomVM version parameters, defaulting to `all` platforms and unknown for the
AtomVM release.

## Would be nice

### Use logger with configurable levels

Logger should be used instead of `io:format/2` for log messages. A configurable
log file should be used, defaulting to a log file in the users cache directory
that is overwritten on each run. The log level should be configurable, as well
as the option for changing the log file name and location.

#### Refactor error handling and logging

Errors should be refactored to return atom() "reasons", and the conversion to
log messages should be handled by dispatch to an error logger.

### Reusable APIs

Most modules should be refactored to better separate logic and IO (reporting
Expand Down
6 changes: 3 additions & 3 deletions generate_fun_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ for PRE_TAG in ${PRE_TAGS_LIST}; do
fi
done

# Sort tags by version (newest first for processing)
# Sort tags by version (oldest first for processing)
# Use git's sort if available, otherwise fall back to lexical sort
if git tag -l --sort=v:refname "v*.*.*" 2>/dev/null | head -1 >/dev/null 2>&1; then
sort -rV "${TMP_TAG_FILE}" > "${TMP_TAG_FILE}.sorted" 2>/dev/null || sort -r "${TMP_TAG_FILE}" > "${TMP_TAG_FILE}.sorted"
sort -V "${TMP_TAG_FILE}" > "${TMP_TAG_FILE}.sorted" 2>/dev/null || sort "${TMP_TAG_FILE}" > "${TMP_TAG_FILE}.sorted"
else
# Lexical sort is acceptable for final ordering
sort -r "${TMP_TAG_FILE}" > "${TMP_TAG_FILE}.sorted"
sort "${TMP_TAG_FILE}" > "${TMP_TAG_FILE}.sorted"
fi
mv "${TMP_TAG_FILE}.sorted" "${TMP_TAG_FILE}"

Expand Down
2 changes: 2 additions & 0 deletions include/ecosystem.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
-define(ECOSYSTEM_HRL, true).

-define(ECOSYSTEM_STATE, "beam_ecosystem.bin").
-define(GITHUB_MAX_PER_QUERY, 1000).
-define(HEX_PER_PAGE, 100).

-endif.
28 changes: 28 additions & 0 deletions include/function.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
%%
%% Copyright (c) 2026 Winford (UncleGrumpy) <winford@object.stream>
%%
%% This is part of atomvm_spectrometer
%%
%% SPDX-FileCopyrightText: 2026 Winford (UncleGrumpy) <winford@object.stream>
%% SPDX-License-Identifier: Apache-2.0

-ifndef(FUNCTION_HRL).
-define(FUNCTION_HRL, true).

-type version_tuple() ::
{Major :: non_neg_integer(), Minor :: non_neg_integer(), Patch :: non_neg_integer()}
| {release, Major :: non_neg_integer(), Minor :: non_neg_integer()}
| {main, Major :: non_neg_integer(), Minor :: non_neg_integer()}.

-type platform() :: esp32 | emscripten | generic_unix | rp2 | stm32.

-type platform_versions() :: #{platform() | all => version_tuple()}.

-record(function, {
name :: binary(),
arity :: non_neg_integer() | all,
since_map :: platform_versions(),
removed :: version_tuple() | undefined
}).

-endif.
Loading
Loading