Coder Social home page Coder Social logo

hshq / harelang Goto Github PK

View Code? Open in Web Editor NEW
64.0 3.0 4.0 6.15 MB

A macos port of the hare language (https://harelang.org). See README.darwin.

License: Other

Makefile 89.39% Shell 0.61% Assembly 9.22% Scala 0.06% SuperCollider 0.72%
harelang macos aarch64 x86-64

harelang's Introduction

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.

harelang's People

Contributors

any1 avatar apreiml avatar arminweigl avatar autumnull avatar bitfehler avatar cmriedl avatar dankrank avatar ddevault avatar engulf1748 avatar esawady avatar fluix-dev avatar handlerug avatar hshq avatar hummer12007 avatar kiedtl avatar lanodan avatar lassipulkkinen avatar laumann avatar mallorya avatar maxgyver83 avatar noocsharp avatar pierrec avatar sertonix avatar smlavine avatar spxtr avatar tomleb avatar unereal avatar vladh avatar vyivel avatar yerinalexey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

harelang's Issues

Can't buid it on macos sonoma

Following the install on hare website but it doesnt work here:

cp configs/darwin.mk config.mk   
make

-> gives error :

 /rt/+darwin/arch.sh no such file

doing export HAREC_SRC=. doesn't help either.
In fact in the rt/+darwin folder there is no arch.sh at all.
Only this file which is similar in name (but is probably not the one we need here):

 rt/+darwin/+aarch64.ha  

darwin不需要设置TMPDIR和XDG_CACHE_HOME

macos

  • TMPDIR系统默认就在/var/folders/...一个文件夹里, 重起就会自动清除, 所以建议不修改
  • XDG_CACHE_HOME也不用设置 为空时系统默认缓存文件夹就在~/.cache, 如果改成$HARECACHE其它工具的 cache可能会存到你的HARECACHE文件夹里 造成多余的文件
# 只需要这3个变量就可以了 已测试, 目前我的项目是这样用的
export HARECACHE=~/.cache/hare
export HAREC_SRC=.../harec
export QBE=$HAREC_SRC/rt/+darwin/qbe.sh

编译调用c库的错误都还在

用你的 harec/hare 在本机测试

我也是老机器MacBook Pro (Retina, 13-inch, Late 2013) macOS Big Sur 11.7.10
老机器最多升级到osx 11.7, osx11以后的版本 加sudo也不能添加和修改/tmp /Volumes这些系统级的地方

  • 用hello world 直接就能编译测试hare build -lc main.ha, 编译失败 提示需要-Wl,-no_pie
To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
final section layout:
    __TEXT/__text addr=0x10000139A, size=0x0005A886, fileOffset=0x0000139A, type=1
    __TEXT/__stubs addr=0x10005BC20, size=0x00000054, fileOffset=0x0005BC20, type=29
    ... ...
ld: 32-bit RIP relative reference out of range (-4294992379 max is +/-2GB): from _main (0x1000061DF) to _environ@0x00000000 (0x00000000) in '_main' ...
  • 上面编译失败的问题 在cc.sh里加上 这段-Wl,-no_pie 就可以解决
 -Wl,--no-gc-sections)
            args="$args -Wl,-no_pie"
            ;;
  • 解决上面的问题, 继续编译 新的错误提示 (这是缺少+libc.s, 直接编译是加不了include的, 而且加了还是这个 错误)
duplicate symbol '___test_array_start' in:
    .../T/start+libc-a41dce.o
.../Hares/_hare/src/hare/stdlib/rt/6e987e1c9a48ab7f5d4200af30e91284ef97f1e0837a6a18d66e85538de0ba7d.o
duplicate symbol '___libc_init_array_start' in:
    .../T/start+libc-a41dce.o
 .../Hares/_hare/src/hare/stdlib/rt/6e987e1c9a48ab7f5d4200af30e91284ef97f1e0837a6a18d66e85538de0ba7d.o
duplicate symbol '___fini_array_start' in:
  ... ...
  • 你说要 makefile里加include 也试了, 同样编译失败, 因为config.mk里都是 ld/as/qbe = ./rt/... 之后我把config.mk的 全改成了ld = $(HAREC_SRC)/rt/....完整地址 同样是上面的___test_array_start ...错误
# include $(HAREC_SRC)/config.mk
# LIBS=-lc -lSDL2_image -lSDL2_mixer -lSDL2
make
hare build -lc -lSDL2_image -lSDL2_mixer -lSDL2 cmd/demo
2/100 tasks completed (2%)Error: Command not found: ./rt/+darwin/qbe.sh
  • 后面我都加上我之前用的+libc.s 还是全出错
hare build -lc
0/1 tasks completed (0%)
ld: illegal text-relocation to '_environ' in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libc.tbd from '_main' in /Users/Angluca/.cache/hare/Users/Angluca/SDK/Hares/_hare/src/hare/stdlib/rt/6e987e1c9a48ab7f5d4200af30e91284ef97f1e0837a6a18d66e85538de0ba7d.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

build error

doesnt build

$ make
make: hare-arch.sh: Command not found
Makefile:11: makefiles/darwin..mk: No such file or directory
make: *** No rule to make target `makefiles/darwin..mk'.  Stop.
2$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.