HN 표시: GUI를 스크립트로 실행

hackernews | | 📦 오픈소스
#ai 서비스 #gui 자동화 #스크립트 #오픈소스 #포터블 앱
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

해커 뉴스(Show HN)에 게시된 이 글은 사용자가 작성한 GUI 코드를 스크립트처럼 실행하여 즉시 화면에 렌더링할 수 있는 새로운 도구를 소개합니다. 이 방식은 별도의 복잡한 빌드 과정 없이도 간편한 명령어로 그래픽 인터페이스를 실행하고 테스트할 수 있는 환경을 제공하여, 개발 효율성을 크게 높이는 것을 목표로 하고 있습니다.

본문

A project for making portable apps and games using hokusai Work in progress, expect changes. ideas and contributions are welcome. Hokusai pocket uses barista for bootstrapping itself. Note: It is not recommended to build this project with mrbgems. git clone https://github.com/skinnyjames/hokusai-pocket.git && cd hokusai-pocket barista cli - this command will compile mruby/tree-sitter/raylib and produce a hokusai-pocket binary inbin/ - this command will compile mruby/tree-sitter/raylib and produce a To run apps using the binary hokusai-pocket run:target= - where is a hokusai app - where To package your app as a binary for the host system from this repo hokusai-pocket build:target= - where is a hokusai app - where To cross-compile your app for different platforms (wip, requires docker) hokusai-pocket publish:target= - optional arguments include - assets_path=[assets folder] - platforms=osx (defaults to osx,linux,windows) - extras=[folders accessible to the build] (useful for including custom gems) - gem_config=[file declaring conf.gems] (useful for adding gems) - optional arguments include This will create a platforms/[platform]/[target]/[targetfile] for each included platform An example app that can be run with hokusai-pocket run:target=counter.rb # counter.rb class Counter 0 end def increment(event) self.count += 1 end def decrement(event) self.count -= 1 end def count_color count.negative? ? [244, 0, 0] : [0, 0, 244] end def initialize(**args) @count = 0 super end end Hokusai::Backend.run(Counter) do |config| config.title = "Counter" # title config.fps = 60 # set frames per second config.width = 550 config.height = 500 config.after_load do # register fonts Hokusai.fonts.register "default", Hokusai::Backend::Font.default Hokusai.fonts.activate "default" end end First, build or obtain a barista binary barista cli will initially build the following archives in vendor in addition to the hokusai-pocket binary * libtree-sitter.a [task: treesitter] * libraylib.a [task: raylib] * libmruby.a [task: mruby] * libhokusai.a [task: hokusai] When updating any hokusai code, just run barista hokusai to update libhokusai.a . To modify the build process for mruby, raylib, or tree-sitter, adjust the Brewfile and rebuild that task. barista clean will remove the vendor library. More soon. The project structure is /bin hokusai-pocket (the binary) /grammar (the tree sitter grammar for the templates) /ruby (the hokusai ruby project) /mrblib (the hokusai ruby project as a single file) /src (supporting c files) Brewfile (the build file for the project) hokusai pocket supports a basic implementation of require_relative in the ruby code. It will perform basic subsitution and generate one large ruby file to be compiled using mrbc - Taylor - A simple game engine built using raylib and mruby - Ruby 2D - Make cross-platform 2D applications in Ruby - DragonRuby - DragonRuby is a Multilevel Cross-platform Runtime. The “multiple levels” within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Stadia.

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →