mruby/C和picoruby:在低端设备上使用的高级语言?
Mruby/C and picoruby: high level langs in low-level devices?

原始链接: https://github.com/picoruby/picoruby

PicoRuby是mruby的轻量级替代品,专为资源受限的环境而设计。它具有极小的占用空间(256KB ROM,128KB RAM),仅依赖标准C库以保证可移植性。从GitHub克隆仓库后,可以使用`rake`轻松编译。工具链提供`picorubyc`将Ruby代码编译成`.mrb`字节码,以及`picoruby`直接执行Ruby脚本。针对树莓派Pico(Cortex-M0+)的构建配置示例可用。PicoRuby仍在开发中,路线图见issue/6。欢迎通过fork、补丁和pull request贡献代码。开发部分得到了Ruby协会资助计划的支持。它采用MIT许可证授权。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 mruby/C 和 picoruby:在低端设备上使用高级语言? (github.com/picoruby) 4 分,由 rahil627 3 小时前发布 | 隐藏 | 过去 | 收藏 | 1 条评论 rahil627 3 小时前 [–] 有些人讨厌使用 C 语言。有些人则喜欢它,甚至热爱它(包括许多游戏开发者!)。你可以完全掌控它!但我想知道,HN 的朋友们对这些针对微型设备(例如传感器)的 Ruby 实现有何看法?我的意思是……C 语言真的那么糟糕吗?另外,它们仍在维护中,这非常酷! 回复 加入我们,参加 6 月 16-17 日在旧金山举行的 AI 初创公司学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:
相关文章
  • (评论) 2024-08-22
  • 因特福斯 2023-11-08
  • TinyML:超低功耗机器学习 2024-01-17
  • (评论) 2023-12-26
  • (评论) 2024-08-31

  • 原文

    C/C++ CI

    PicoRuby is an alternative mruby implementation which is:

    • Small foot print
      • ROM: 256 KB (depending on build config)
      • RAM: 128 KB or less (depending on app code)
      • (Figures in 32 bit architecture)
    • Portable
      • Depends on only standard C library such as glibc, Newlib or Newlib-nano
    • Reference microcontroller boards
      • Raspberry Pi Pico - Arm Cortex-M0+, 264 KB RAM, 2 MB Flash

    API documentation with some demo videos

    https://picoruby.github.io/

    • Prerequisites
      • C toolchain
      • git
      • ruby (should be CRuby 3.0+)
    git clone --recursive https://github.com/picoruby/picoruby
    cd picoruby/
    rake
    # PICORUBY_DEBUG=1 rake                         # for debug build
    # PICORUBY_DEBUG=1 PICORUBY_NO_LIBC_ALLOC=1 rake  # for debug build using mruby/c's memory allocator
    bin/picoruby -e 'puts "Hello World!"'

    See an example: build_config/r2p2-cortex-m0plus.rb

    rake command will make three kinds of executable binary

    • bin/picorbc
      • bin/picorbc path/to/source.rb makes path/to/source.mrb that is VM code runs on an mruby-compatible virtual machine
    • bin/picoruby
      • bin/picoruby source.rb executes Ruby just like normal ruby command
      • You can do like bin/picoruby path/to/your_script.rb to run your script
    • bin/r2p2

    PicoRuby is still developing halfway towards finishing as of 2024.

    See implementation roadmap on issue/6

    Fork, patch, then send a pull request.

    Part of this project was coded by Monstarlab with the support of the Ruby Association Grant Program 2020 and 2021.

    See also picoruby/picoruby/wiki.

    Stargazers over time

    Copyright © 2020-2024 HASUMI Hitoshi. See MIT-LICENSE for further details.

    Copyright © 2020-2021 Monstarlab. See MIT-LICENSE for further details.

    联系我们 contact @ memedata.com