- Download all files.
- Build the Crystal part:
crystal build --release --cross-compile --prelude ./no_main library.cr
^ You can leave this out
^ We want to link ourselves!
^ Use our custom prelude!
<artifacts_info> | |
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity. | |
# Good artifacts are... | |
- Substantial content (>15 lines) | |
- Content that the user is likely to modify, iterate on, or take ownership of | |
- Self-contained, complex content that can be understood on its own, without context from the conversation | |
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations) | |
- Content likely to be referenced or reused multiple times |
/* Client process that communicates with GNU Emacs acting as server. | |
Copyright (C) 1986-2023 Free Software Foundation, Inc. | |
This file is part of GNU Emacs. | |
GNU Emacs is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or (at | |
your option) any later version. |
Our mission is to “commoditize the petaflop.” By building an ML framework where the engineering cost to add a new accelerator is 10-100x lower than competitors, we lower the cost for new players to enter the market.
Similarly, we lower the cost of new operations and optimizers, allowing ML to avoid local minima. In older versions of PyTorch, batchnorm and groupnorm have very different performance. There’s no fundamental reason for this, it was just because more work had been put into the batchnorm kernels. In tinygrad, all the kernels are compiled on the fly so things like this won’t happen.
#!/usr/bin/env ruby | |
# Function to calculate BMR | |
def calculate_bmr(gender, weight, height, age) | |
if gender.downcase == 'male' | |
return 88.362 + (13.397 * weight) + (4.799 * height) - (5.677 * age) | |
else | |
return 447.593 + (9.247 * weight) + (3.098 * height) - (4.330 * age) | |
end | |
end |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.
For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.
Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.
One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss
Installing pg 1.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
brew install libpq
gem install pg -- --with-pg-config=/usr/local/opt/libpq/bin/pg_config