A systems programming language.
  • Hare 92.8%
  • Makefile 6.4%
  • Assembly 0.7%
Find a file
Hugo Osvaldo Barrera 41e84c1f03 os: make flags optional for os::mlock
On Linux, os::mlock calls mlock2(2), which takes flags. mlock2(2) with
flags zero is equivalent to mlock(2).

Make the flags parameter of os::mlock optional by making zero the
default value. The default behaviour remains the same as the mlock(2)
call on this platform.

This makes os::mlock API-compatible with other platforms where the
underlying system call takes no flags.

Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
2026-06-16 11:56:08 +02:00
.builds .builds: only build on master + tags 2026-05-13 19:18:13 +02:00
arch Move setjmp/longjmp from rt to arch. 2026-04-03 11:50:17 +02:00
ascii ascii::ctype: simplify implementation 2026-04-06 20:52:06 -04:00
bufio bufio: add a seeker for buffered streams that support it 2026-05-18 21:51:45 +02:00
bytes bytes: use a match instead of cast in cut/rcut. 2026-05-16 17:21:58 +02:00
cmd Move init/fini sections and unify platforms 2026-05-18 21:21:02 +02:00
configs Move init/fini sections and unify platforms 2026-05-18 21:21:02 +02:00
crypto crypto::hkdf: Fix expand's assert message 2026-06-13 13:45:00 +02:00
debug stdlib: rename methods that use user provided buffers as _buf 2026-03-31 19:27:18 +02:00
dirs Add one-line module summary to haredoc 2025-06-10 16:04:08 +02:00
docs docs: write hare-version(1) 2026-03-31 19:32:24 +02:00
encoding asn1: require a user supplied buffer in read_rawoid 2026-06-16 11:54:34 +02:00
endian Add one-line module summary to haredoc 2025-06-10 16:04:08 +02:00
errors Separate the rt module into rt, sys, and arch modules. 2026-03-04 12:22:02 +01:00
fmt all: replace void casts with discarding assignment 2025-10-09 19:50:44 +02:00
fnmatch Use _: type throughout Hare. 2025-07-21 09:58:51 +02:00
format all: omit strings::end argument from strings::sub 2026-03-14 17:44:01 -04:00
fs fs, os: improve mkdirs docs 2026-04-13 17:43:46 -04:00
getopt getopt: print help text to stdout when -h is provided 2026-02-01 20:08:14 +00:00
glob glob: remove recursion 2026-03-14 17:44:01 -04:00
hare hare::ast: store location of names in bindings 2026-06-16 11:52:38 +02:00
hash Add one-line module summary to haredoc 2025-06-10 16:04:08 +02:00
io io: implement dup using the dup syscall 2026-06-07 09:53:21 +02:00
linux Separate the rt module into rt, sys, and arch modules. 2026-03-04 12:22:02 +01:00
log Separate the rt module into rt, sys, and arch modules. 2026-03-04 12:22:02 +01:00
makefiles os: implement mlock for OpenBSD 2026-06-16 11:56:07 +02:00
math math::complex: make equal function more generic 2026-05-16 09:06:30 +01:00
memio memio: return nomem on buffer overflow 2026-04-13 21:45:21 -04:00
mime mime: fix memory leaks from unfree hash table slices 2026-01-12 17:36:51 +01:00
net net: improve cmsg documentation 2026-04-25 15:15:50 +02:00
os os: make flags optional for os::mlock 2026-06-16 11:56:08 +02:00
path Separate the rt module into rt, sys, and arch modules. 2026-03-04 12:22:02 +01:00
regex regex: sync README to nomem changes 2026-04-13 17:09:52 -04:00
rt Move init/fini sections and unify platforms 2026-05-18 21:21:02 +02:00
scripts scripts/version: update to 0.26.0 2026-02-13 13:18:15 +01:00
shlex shlex: use memio:: functions in quote 2026-04-13 21:45:21 -04:00
sort fix splitmix64 2026-04-13 17:08:29 -04:00
strconv strconv::stou64 - improve overflow detection 2026-05-03 21:19:07 +01:00
strings strings: add count 2026-06-16 11:51:39 +02:00
sys os: implement mlock for OpenBSD 2026-06-16 11:56:07 +02:00
temp temp::dir: create with mode 0o700 2026-04-03 10:35:12 +02:00
test Move init/fini sections and unify platforms 2026-05-18 21:21:02 +02:00
time time:📅 read LOCALTIME_PATH file directly 2026-06-05 23:45:58 +01:00
types types::c: minor terminology fix in README 2026-03-14 18:44:38 -04:00
unix unix::signal+linux: add SIGSTKFLT 2026-03-14 17:44:00 -04:00
uuid uuid: fix typo in README 2026-01-08 21:38:49 +00:00
wordexp os: nomem changes 2025-06-17 11:33:39 +02:00
.gitignore .gitignore: specify that *.1 and *.5 files are in docs/ 2026-04-13 17:15:16 -04:00
.mailmap Add a mailmap 2022-09-22 11:07:01 +02:00
COPYING COPYING: Remove incompatibility notice 2021-07-17 00:31:40 +02:00
MAINTAINERS crypto: add Runxi Yu as designated reviewer 2026-06-05 14:07:04 +02:00
Makefile Move init/fini sections and unify platforms 2026-05-18 21:21:02 +02:00
README haredoc: support empty ident (to index stdlib) 2021-04-21 09:47:27 -04:00
README.md README.md: drop explanation of non-free spec license 2024-07-03 13:01:21 +02:00
TREES TREES: add my harec and hare-spec trees 2024-12-03 09:10:54 +01:00

The Hare programming language

Hare is a systems programming language.

Installation

For information about bootstrapping a working Hare toolchain from scratch, see Hare Installation on the website.

Contributing

All contributors are required to "sign-off" their commits (using git commit -s) to indicate that they have agreed to the Developer Certificate of Origin, reproduced below.

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Please send patches to the hare-dev mailing list to send your changes upstream.

Licensing

We are not your lawyer, but here is a simple explanation of the intention behind the Hare licenses.

The Hare standard library is available under the terms of the Mozilla Public License (MPL). You can freely link to the standard library with software distributed under any license, but if you modify the standard library, you must release your derivative works under the MPL as well.

The executables - the build driver, hare, and the compiler, harec, are available under the GPL 3.0 (but not any later version). This permits free use and redistribution, but any changes to it require you to share the derivative work under the terms of the GPL. It is stricter than the MPL; if you link to the compiler or build driver code from a third-party program it will require you to release the third-party code as well.

In short, you can write programs in Hare which use the standard library and distribute those programs under any terms you wish. However, if you modify Hare itself, you must share your changes as well.