-
Notifications
You must be signed in to change notification settings - Fork 572
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
Add Primes in Beef #953
Add Primes in Beef #953
Conversation
@rbergen Sorry for all the churn on this PR. I'm still getting the feel for this language. I'm done tinkering with this. |
@rzuckerm Not a problem. I recognized the pattern, so I just waited for things to calm down. :) With you being done making changes, I'll review as soon as I can. In the meantime, could you maybe elaborate a little bit on the nature of the build failures on ARM64? Not to question your conclusion, just because I'm curious. In my simple thinking, in 2024 a new programming language would make an effort to also work on that platform. |
@rbergen The Beef programming language can only be built from source on Linux and MacOS. It requires building a very specific version of LLVM from source. I tried to use some of the LLVM binaries, but I couldn't get the Beef source to build with that. LLVM needs to be built in a very specific way with very specific options enabled. When I tried to build for ARM64, I couldn't get LLVM to compile at all. You're welcome to take a look. Here's the source for my docker image. There are a couple of build scripts that I scraped from the original build system:
|
@rzuckerm You answered my question in the second sentence. Once something requires a specific compiler build to build, I know all bets are off. Thanks for clarifying! |
@rbergen I tried to build it locally, it's not LLVM that is having an issue. It is libffi: $ docker buildx build --builder=mybuilder --platform=linux/arm64 -t rzuckerm/beef:0.43.5a4-dev -f Dockerfile .
...
495.8 Building libffi...
501.2 checking build system type... aarch64-unknown-linux-gnu
502.7 checking host system type... aarch64-unknown-linux-gnu
502.7 checking target system type... aarch64-unknown-linux-gnu
502.9 continue configure in default builddir "./aarch64-unknown-linux-gnu"
503.2 ....exec /bin/bash ..//opt/Beef/BeefySysLib/third_party/libffi/./configure "--srcdir=.." "--enable-builddir=aarch64-unknown-linux-gnu" "linux
503.2 gnu"
503.2 /bin/bash: ..//opt/Beef/BeefySysLib/third_party/libffi/./configure: No such file or directory
504.1 Starting build.sh
504.4 Building from /opt/Beef/bin
504.4 Building libffi...
509.7 checking build system type... aarch64-unknown-linux-gnu
511.3 checking host system type... aarch64-unknown-linux-gnu
511.3 checking target system type... aarch64-unknown-linux-gnu
511.5 continue configure in default builddir "./aarch64-unknown-linux-gnu"
511.8 ....exec /bin/bash ..//opt/Beef/BeefySysLib/third_party/libffi/./configure "--srcdir=.." "--enable-builddir=aarch64-unknown-linux-gnu" "linux
511.8 gnu"
511.9 /bin/bash: ..//opt/Beef/BeefySysLib/third_party/libffi/./configure: No such file or directory It didn't spend too much time trying to figure out why this was happening. |
What I meant was that when things are so brittle that you need to first compile a specific build of the compiler before you can build what you're actually building, things tend to break very easily further down the line. Looking at the error (thanks for sharing that) I don't think it would be too difficult to fix that one, but it's not a reasonable ask of contributors to this project to debug embedded dependencies of the languages they write solutions for. Also, when the error you run into now is fixed, you may well run into another one immediately after - turning the process into the proverbial rabbit hole. This being the case, I'm okay with making this an AMD64-only solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This being a new solution in a new language, I'll ask for a review from @marghidanu as well. In the meantime, I'll update PrimeView's language map to also include Beef.
@rbergen Is there someone else that can review this PR? @marghidanu seems to be unavailable. |
No, since Dave handed over the proverbial keys to this repo and Rolf left the project, @marghidanu and I are the two maintainers. I'll ask him if he can review via another channel, otherwise I'll apply "he who is silent agrees" in a few days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Prime sieve in Beef. I couldn't get the build for the Beef GitHub repo to work for ARM64, so the image will only work on AMD64.
Contributing requirements
drag-race
as the target branch.