Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
with:
file: Dockerfile
tags: arkscript/nightly:latest,arkscript/nightly:${{ env.sha_short }}
push: true
# keep .git repository
context: .

Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

### Deprecations
- `std.Range` has been entirely deprecated and is scheduled for removal
- `bitwise` module is deprecated in favor of new builtins, included in `std.Math`

### Added
- standard library:
Expand All @@ -21,12 +22,33 @@
- string:first
- string:last
- string:codepoints
- math:countOnes
- math:countZeros
- math:bitNot
- math:bitAnd
- math:bitOr
- math:bitXor
- math:lshift
- math:rshift
- math:bitCeil
- math:bitFloor
- math:bitWidth
- math:countLeftZeros
- math:countLeftOnes
- math:countRightZeros
- math:countRightOnes
- math:circularLeftShift
- math:circularRightShift
- math:toBase
- math:countDigits
- new builtin `builtin__string:codepoints` returning the Unicode codepoints of a string as a list of numbers
- new bitwise builtins

### Changed
- `$repr` shows the correct representation for macros
- `$symcat` accepts symbols and strings as its first argument
- `math:pow` uses a more precise way of computing values when inputs are integers
- docker images use alpine 3.23 as a base instead of 3.21

### Removed

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.21 AS permissions-giver
FROM alpine:3.23 AS permissions-giver

WORKDIR /out

FROM alpine:3.21 AS submodule-initializor
FROM alpine:3.23 AS submodule-initializor

# Install git
RUN apk --no-cache add git
Expand All @@ -19,7 +19,7 @@ RUN git submodule update --init --recursive \
&& rm -rf `find . -type d -name ".git"` \
&& rm .gitmodules

FROM alpine:3.21 AS builder
FROM alpine:3.23 AS builder

# Install cmake
RUN apk --no-cache add cmake clang make libc-dev linux-headers
Expand All @@ -41,15 +41,15 @@ RUN cmake -H. -Bbuild \
-DARK_BUILD_DATE="$(date +%Y-%m-%dT%H:%M:%SZ)" \
&& cmake --build build --target arkscript -- -j $(nproc)

FROM alpine:3.21 AS organizer
FROM alpine:3.23 AS organizer

# Files needed to run Ark
WORKDIR /out/ark
COPY --from=builder build build
COPY --from=builder include include
COPY --from=builder lib lib

FROM alpine:3.21 AS runner
FROM alpine:3.23 AS runner

# Install cmake
RUN apk --no-cache add cmake
Expand Down
10 changes: 5 additions & 5 deletions harden.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.21 AS permissions-giver
FROM alpine:3.23 AS permissions-giver

WORKDIR /out

FROM alpine:3.21 AS submodule-initializor
FROM alpine:3.23 AS submodule-initializor

# Install git
RUN apk --no-cache add git
Expand All @@ -19,7 +19,7 @@ RUN git submodule update --init --recursive \
&& rm -rf `find . -type d -name ".git"` \
&& rm .gitmodules

FROM alpine:3.21 AS builder
FROM alpine:3.23 AS builder

# Install cmake
RUN apk --no-cache add cmake clang make
Expand All @@ -42,15 +42,15 @@ RUN cmake -H. -Bbuild \
-DARK_BUILD_DATE="$(date +%Y-%m-%dT%H:%M:%SZ)" \
&& cmake --build build --target arkscript -- -j $(nproc)

FROM alpine:3.21 AS organizer
FROM alpine:3.23 AS organizer

# Files needed to run Ark
WORKDIR /out/ark
COPY --from=builder build build
COPY --from=builder include include
COPY --from=builder lib lib

FROM alpine:3.21 AS runner
FROM alpine:3.23 AS runner

# Install cmake
RUN apk --no-cache add cmake
Expand Down
16 changes: 16 additions & 0 deletions include/Ark/Builtins/Builtins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ namespace Ark::internal::Builtins
ARK_BUILTIN(atanh_);

ARK_BUILTIN(random);

ARK_BUILTIN(countOnes);
ARK_BUILTIN(countZeros);
ARK_BUILTIN(bitwiseNot);
ARK_BUILTIN(bitwiseAnd);
ARK_BUILTIN(bitwiseOr);
ARK_BUILTIN(bitwiseXor);
ARK_BUILTIN(bitwiseRshift);
ARK_BUILTIN(bitwiseLshift);
ARK_BUILTIN(bitCeil);
ARK_BUILTIN(bitFloor);
ARK_BUILTIN(bitWidth);
ARK_BUILTIN(countLeftZeros);
ARK_BUILTIN(countLeftOnes);
ARK_BUILTIN(countRightZeros);
ARK_BUILTIN(countRightOnes);
}

namespace Async
Expand Down
1 change: 1 addition & 0 deletions include/Ark/VM/Value/Value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ namespace Ark
{}

explicit Value(int value) noexcept;
explicit Value(int64_t value) noexcept;
explicit Value(double value) noexcept;
explicit Value(const String_t& value) noexcept;
explicit Value(const char* value) noexcept;
Expand Down
2 changes: 1 addition & 1 deletion lib/modules
2 changes: 1 addition & 1 deletion lib/std
Submodule std updated 2 files
+228 −0 Math.ark
+59 −1 tests/math-tests.ark
15 changes: 15 additions & 0 deletions src/arkreactor/Builtins/Builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ namespace Ark::internal::Builtins
{ "builtin__math:asinh", Value(Mathematics::asinh_) },
{ "builtin__math:atanh", Value(Mathematics::atanh_) },
{ "random", Value(Mathematics::random) },
{ "builtin__math:countOnes", Value(Mathematics::countOnes) },
{ "builtin__math:countZeros", Value(Mathematics::countZeros) },
{ "builtin__math:bitNot", Value(Mathematics::bitwiseNot) },
{ "builtin__math:bitAnd", Value(Mathematics::bitwiseAnd) },
{ "builtin__math:bitOr", Value(Mathematics::bitwiseOr) },
{ "builtin__math:bitXor", Value(Mathematics::bitwiseXor) },
{ "builtin__math:rshift", Value(Mathematics::bitwiseRshift) },
{ "builtin__math:lshift", Value(Mathematics::bitwiseLshift) },
{ "builtin__math:bitCeil", Value(Mathematics::bitCeil) },
{ "builtin__math:bitFloor", Value(Mathematics::bitFloor) },
{ "builtin__math:bitWidth", Value(Mathematics::bitWidth) },
{ "builtin__math:countLeftZeros", Value(Mathematics::countLeftZeros) },
{ "builtin__math:countLeftOnes", Value(Mathematics::countLeftOnes) },
{ "builtin__math:countRightZeros", Value(Mathematics::countRightZeros) },
{ "builtin__math:countRightOnes", Value(Mathematics::countRightOnes) },

// Async
{ "async", Value(Async::async) },
Expand Down
Loading
Loading