Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active February 3, 2020 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/3cb178eae5605cf7c6fdc6f19f521d38 to your computer and use it in GitHub Desktop.
Save maiha/3cb178eae5605cf7c6fdc6f19f521d38 to your computer and use it in GitHub Desktop.
Ponyまとめ

概要

Pros
  • 静的型付け言語
  • ネイティブコード生成 (LLVM)
  • static nativeバイナリ作成可能
  • capabilities-secure (型安全, メモリセーフ, 例外安全, データ競合フリー, デッドロックフリー)
  • 並列処理 (Actor)
  • マルチコア性能 (Erlang, Scalaより高速) https://www.ponylang.io/benchmarks_all.pdf
  • C/C++との親和性
  • オブジェクト指向
  • パターンマッチ (Haskell風)
  • 標準ライブラリ (json, http, ssl)
  • endが不要 (class, actor, new, fun)
Cons
  • 品質が不明 (安定性、production ready)
  • ライブラリが少ない (標準は最低限のみ, 3rd partyライブラリが少ない, 但しclibが使える)
  • 将来性が不明 (開発元のCausality社が2016に資金的な問題で撤退)
  • endが必要 (if, for, try, match) で言語仕様の一貫性に疑問

compile

static binary を作る(musl)
DOCKER_IMAGE=ponylang/ponyc:0.33.1-alpine

NAME=$(notdir $(PWD))
DOCKER=docker run -it -v $(PWD):/$(NAME) -w /$(NAME) --rm $(DOCKER_IMAGE)
COMPILE=ponyc -b $(NAME) --static --triple=x86_64-unknown-linux-musl --link-ldcmd=bfd
CHOWN=chown -R $(shell id -u):$(shell id -g)
UMOUNT=$(CHOWN) $(NAME)

compile:
        $(DOCKER) sh -c "$(COMPILE); $(UMOUNT)"

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment