Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(default.nix): Init in /compiler+runtime #94

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d4508cd
feat(default.nix): Init in /comipler+runtime
haruki7049 Oct 3, 2024
f4472b8
chore(default.nix): Add pname, version and src
haruki7049 Oct 3, 2024
fe68684
WIP
haruki7049 Oct 3, 2024
bc61d1c
WIP
haruki7049 Oct 4, 2024
7585782
chore(default.nix): Edit
haruki7049 Oct 4, 2024
0a25489
fix(cmake/llvm.cmake): Edit versions and logics
haruki7049 Oct 4, 2024
c9d00c7
chore(default.nix): Add some buildInputs
haruki7049 Oct 4, 2024
b7348a1
deps(nix-dir): Add some deps written by nix
haruki7049 Oct 4, 2024
cc7168b
chore(CmakeLists.txt): Comment out to not copy clang-format
haruki7049 Oct 4, 2024
261d738
deps(folly): Init, but WIP
haruki7049 Oct 4, 2024
52a34c0
chore(folly): Change src to use local submodule
haruki7049 Oct 4, 2024
c517de9
chore(boehmgc): Add cmakeFlags to enable_cplusplus=ON
haruki7049 Oct 4, 2024
86510ac
chore(default.nix): Edit
haruki7049 Oct 4, 2024
a11b94b
chore(folly): Delete unused nix file
haruki7049 Oct 4, 2024
45a5bfe
chore(CMakeLists.txt): Add OpenSSL
haruki7049 Oct 5, 2024
865b7fa
WIP
haruki7049 Oct 5, 2024
ed20d63
chore(nix-stdenv): Change pkgs.stdenv to llvmPackages_19.stdenv
haruki7049 Oct 13, 2024
79b9fbc
fix(cmake-flags): Fix typo
haruki7049 Oct 13, 2024
a54a6e0
deps(buildInputs): Delete pkgs.libcxx
haruki7049 Oct 13, 2024
2d52f14
WIP
haruki7049 Oct 13, 2024
ac9ee13
WIP
haruki7049 Oct 14, 2024
2d45d67
WIP
haruki7049 Oct 14, 2024
3f60ab5
Merge main branch
haruki7049 Oct 30, 2024
c221ce9
Merge main branch
haruki7049 Nov 2, 2024
3e3a3bd
Merge main branch
haruki7049 Nov 10, 2024
cd31331
chore(nix/readline.nix): Remove because this is unused
haruki7049 Nov 10, 2024
7bc301b
Merge llvm-ir branch
haruki7049 Jan 11, 2025
9f052d8
fix: Fix some points
haruki7049 Jan 11, 2025
c58ec09
Merge main branch
haruki7049 Jan 11, 2025
a3e7af9
Merge main branch
haruki7049 Jan 12, 2025
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
13 changes: 13 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ modernize-*,\
bugprone-*,\
performance-*,\
readability-*,\
misc-const-correctness,\
misc-use-internal-linkage,\
misc-static-assert,\
misc-redundant-expression,\
misc-misleading-identifier,\
misc-definitions-in-headers,\
-clang-analyzer-cplusplus.NewDeleteLeaks,\
-clang-analyzer-cplusplus.NewDelete,\
-modernize-use-trailing-return-type,\
-modernize-use-nodiscard,\
-modernize-pass-by-value,\
Expand All @@ -22,8 +29,12 @@ readability-*,\
-cppcoreguidelines-pro-type-static-cast-downcast,\
-cppcoreguidelines-pro-type-const-cast,\
-cppcoreguidelines-owning-memory,\
-cppcoreguidelines-avoid-const-or-ref-data-members,\
-cppcoreguidelines-rvalue-reference-param-not-moved,\
-bugprone-easily-swappable-parameters,\
-bugprone-reserved-identifier,\
-bugprone-multi-level-implicit-pointer-conversion,\
-bugprone-crtp-constructor-accessibility,\
-readability-redundant-member-init,\
-readability-implicit-bool-conversion,\
-readability-magic-numbers,\
Expand All @@ -36,6 +47,8 @@ readability-*,\
-readability-convert-member-functions-to-static,\
-readability-isolate-declaration,\
-readability-qualified-auto,\
-readability-redundant-declaration,\
-readability-use-anyofallof,\
-performance-noexcept-move-constructor,\
-performance-move-const-arg"

Expand Down
34 changes: 21 additions & 13 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,36 @@ runs:
- if: runner.os == 'Linux'
name: Install apt packages
shell: bash
run: sudo apt-get install -y curl git zip build-essential entr libssl-dev libdouble-conversion-dev pkg-config ninja-build python3-pip cmake debhelper devscripts gnupg zlib1g-dev entr libffi-dev clang libjemalloc-dev libreadline-dev libzstd-dev
run: sudo apt-get install -y curl git git-lfs zip build-essential entr libssl-dev libdouble-conversion-dev pkg-config ninja-build python3-pip cmake debhelper devscripts gnupg zlib1g-dev entr libffi-dev clang libzip-dev libbz2-dev doctest-dev libboost-all-dev gcc-14 g++-14
- if: runner.os == 'macOS'
name: Install brew packages
shell: bash
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install curl git zip openssl double-conversion pkg-config ninja python cmake gnupg zlib
- name: Cache vcpkg packages
uses: actions/cache@v3
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install curl git git-lfs zip entr openssl double-conversion pkg-config ninja python cmake gnupg zlib doctest boost libzip lbzip2
- name: Restore cached Clang/LLVM
id: restore-clang-cache
uses: actions/cache/restore@v4
with:
path: |
~/.cache/vcpkg
${{ github.workspace }}/build/vcpkg_installed
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('vcpkg.json') }}
- name: Cache Clang/LLVM
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('compiler+runtime/bin/build-clang') }}
${{ github.workspace }}/compiler+runtime/build
key: ${{ runner.os }}-${{ hashFiles('compiler+runtime/bin/build-clang') }}
- name: Compile and test
shell: bash
working-directory: ${{ github.workspace }}/compiler+runtime
run: ${{ github.workspace }}/compiler+runtime/bin/ci/test -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Store cached Clang/LLVM
id: save-clang-cache
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/compiler+runtime/build
key: ${{ steps.restore-clang-cache.outputs.cache-primary-key }}
# We need to validate formatting after building, since we build Clang/LLVM as part of our
# build process and we need clang-format from that local Clang build in order to have
# consistent formatting results.
- name: Validate formatting
shell: bash
working-directory: ${{ github.workspace }}/compiler+runtime
run: ${{ github.workspace }}/compiler+runtime/bin/ci/validate-formatting
- if: ${{ env.CODECOV }} == "on"
name: Upload report to Codecov
uses: codecov/codecov-action@v3
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
matrix:
# TODO: sanitize: [On, Off]
os: [ubuntu-24.04]
build_type: [Debug, Release]
# TODO: Enable release once we no longer have a Clang crash:
# https://github.com/jank-lang/jank/actions/runs/12269972895/job/34234432107
build_type: [Debug]
include:
- os: ubuntu-24.04
cc: clang-14
Expand All @@ -28,13 +30,14 @@ jobs:
ANALYSIS: ${{ matrix.analysis }}
timeout-minutes: 240 # 4h
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/build
- name: Build and test
uses: ./.github/actions/build
id: build
with:
update_release: ${{ matrix.build_type == 'Release' }}
update_release: ${{ github.ref == 'refs/heads/main' && matrix.build_type == 'Release' }}
- name: Update latest release
if: success() && github.ref == 'refs/heads/main' && ${{ matrix.build_type == 'Release' }}
uses: pyTooling/Actions/releaser@main
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,3 @@ jobs:
- name: Lint bash scripts
working-directory: ${{ github.workspace }}/compiler+runtime
run: ./bin/ci/lint
# TODO: Enable once 19 is released.
#- name: Run clang-format on compiler+runtime/include/cpp
# uses: jidicula/[email protected]
# with:
# clang-format-version: 18
# check-path: compiler+runtime/include/cpp
#- name: Run clang-format on compiler+runtime/src/cpp
# uses: jidicula/[email protected]
# with:
# clang-format-version: 18
# check-path: compiler+runtime/src/cpp
#- name: Run clang-format on compiler+runtime/test/cpp
# uses: jidicula/[email protected]
# with:
# clang-format-version: 18
# check-path: compiler+runtime/test/cpp
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
test.jank
jank-generated.hpp
.jank-repl-history
a.out
.jank-native-repl-history
.jank-repl-history

# Vim files
/.ycm_extra_conf.py*
Expand Down Expand Up @@ -40,3 +43,6 @@ CMakeUserPresets.json

# Rust
rust/jank

# secrets
.github_access_token
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@
[submodule "compiler+runtime/third-party/bpptree"]
path = compiler+runtime/third-party/bpptree
url = https://github.com/jank-lang/BppTree.git
[submodule "compiler+runtime/third-party/bdwgc"]
path = compiler+runtime/third-party/bdwgc
url = https://github.com/jank-lang/bdwgc.git
[submodule "compiler+runtime/third-party/fmt"]
path = compiler+runtime/third-party/fmt
url = https://github.com/jank-lang/fmt.git
[submodule "compiler+runtime/third-party/immer"]
path = compiler+runtime/third-party/immer
url = https://github.com/jank-lang/immer.git
[submodule "compiler+runtime/third-party/cli11"]
path = compiler+runtime/third-party/cli11
url = https://github.com/jank-lang/CLI11.git
[submodule "compiler+runtime/third-party/libzippp"]
path = compiler+runtime/third-party/libzippp
url = https://github.com/jank-lang/libzippp.git
[submodule "compiler+runtime/third-party/boost-preprocessor"]
path = compiler+runtime/third-party/boost-preprocessor
url = https://github.com/jank-lang/boost-preprocessor.git
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jank's host is LLVM and its interop is with C++.
For the current progress of jank and its usability, see the tables here: https://jank-lang.org/progress/

The current tl;dr for jank's usability is: **still getting there, but not ready for
use yet**.
use yet. Check back in a few months!**

## Latest binaries
There are pre-compiled binaries for Ubuntu 22.04, which are built to follow the
There are pre-compiled binaries for Ubuntu 24.04, which are built to follow the
`main` branch. You can download a tarball with everything you need here: https://github.com/jank-lang/jank/releases/tag/latest

## Appetizer
Expand All @@ -49,13 +49,10 @@ There are pre-compiled binaries for Ubuntu 22.04, which are built to follow the
; Many core functions for working with immutable data.
(apply + (distinct [12 8 12 16 8 6])) ; => 42

; Interop with C++ can happen through inline C++.
; Interop with C++ can happen *seamlessly*.
(defn sleep [ms]
(let [ms (int ms)]
; A special ~{ } syntax can be used from inline C++ to interpolate
; back into jank code.
(native/raw "auto const duration(std::chrono::milliseconds(~{ ms }->data));
std::this_thread::sleep_for(duration);")))
(let [duration (c++/std.chrono.milliseconds ms)]
(c++/std.this_thread.sleep_for duration)))
```

## Docs
Expand All @@ -73,12 +70,6 @@ If you'd like your name, company, or logo here, you can
</a>
</p>

<p align="center">
<a href="https://devcarbon.com/">
devcarbon.com
</a>
</p>

<p align="center">
<a href="https://pitch.com/">
Misha Karpenko
Expand Down
8 changes: 8 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Security Policy

## Reporting a Vulnerability
We appreciate your efforts to responsibly disclose your findings and will make every effort to acknowledge your contributions.

To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/jank-lang/jank/security/advisories/new) tab.

The jank team will send a response indicating the next steps in handling your report. After the initial reply to your report, the jank team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
2 changes: 2 additions & 0 deletions compiler+runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Nix's result
result
Loading