关于用于嵌入式系统编程的最合适(最佳)语言的建议?

发布于 2024-07-15 12:39:33 字数 297 浏览 2 评论 0原文

我正在考虑为大约 20MHz、具有 6mb RAM、ARM32 处理器的设备进行嵌入式编码。 谁能建议最好/最合适的嵌入式系统编程语言? 我正在考虑:

  • Lua
  • TinyPy
  • C
  • Java ME
  • C#
  • 有人建议 JavaScript

有什么建议吗? 谢谢

编辑 - 看起来 C 和 Lua 是赢家。 大家干杯!

编辑-实时不是问题,更多的是有限的内存/CPU 决定的事情。

I'm looking at doing embedded coding for a device that's approximately 20MHz, has 6mb ram, with an ARM32 processor. Can anyone suggest the best / most appropriate language for programming an embedded system? I'm considering:

  • Lua
  • TinyPy
  • C
  • Java ME
  • C#
  • someone has suggested JavaScript

Any suggestions? Thanks

Edit - looks like C and Lua are the winners. Cheers all!

Edit - Real Time is not an issue, its more the limited ram/cpu dictating things.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

还如梦归 2024-07-22 12:39:33

如果您要从头开始开发设备或直接与非标准外设连接,C 确实是唯一的选择。

如果您已经拥有嵌入式操作系统或者可以毫无困难地移植一个操作系统,那么您在添加一种更多脚本语言时可能会更加灵活。 除非您使用的是 WinCE,否则 C# 是不可能的,然后您将仅限于 .NET Micro。

除此之外,如果不描述您的设备的用途,“最佳”就没有什么意义。 有些语言比其他语言对某些任务有更好的支持。

If you're bringing the device up from scratch or interfacing directly with non-standard peripherals, C is really the only way to go.

If you've already got an embedded OS or can port one without difficulty, you might have more flexibility in adding one of the more script-y languages. C# is out of the question unless you're on WinCE, and then you'll be restricted to .NET Micro.

Beyond that, "best" has little meaning without describing what your device is going to be used for. Some languages have better support for certain tasks than others.

冰雪梦之恋 2024-07-22 12:39:33

对于如此有限的 CPU 资源,C 可能是您的最佳选择。

C is probably your best bet for such limited cpu resources.

溺渁∝ 2024-07-22 12:39:33

在 ARM OMAP 处理器上使用了 Lua。 Lua 与 C 的紧密集成允许您在需要时随时使用,而且它的小尺寸使其适用于广泛的平台。 我在 Mac 上使用 Lua 为固件开发了 UI,然后将其直接移植到嵌入式平台,没有进行任何更改。

虽然 OMAP 处理器足够强大,可以运行 Java 或 Python 等其他语言,但当我开始编写代码时,我并不知道我的目标硬件是什么。 Lua 是一个安全的选择。

I've used Lua on an ARM OMAP processor. Lua's tight integration with C allows going to the metal whenever you need, and its small size makes it suitable for a wide range of platforms. I developed the UI for my firmware in Lua on my mac and then brought it over to the embedded platform with no changes.

While the OMAP processor was beefy enough to run other languages like Java or Python, I didn't know what hardware I was targeting when I started the code. Lua was a safe bet.

嘿看小鸭子会跑 2024-07-22 12:39:33

我很想直接使用 C,但我已经编写 C 近 30 年了。 对我来说,Lua 和 TinyPy 似乎太新了、太实验性了; 嵌入式设备需要非常强大。

Java ME 有其优点。 我不了解嵌入式世界中的 C#。

I'd be tempted to go with straight C, but then I've been writing C for nearly 30 years. Lua and TinyPy seem too new, experimental, to me; embedded devices need to be very robust.

Java ME has good points. I don't know about C# in an embedded world.

机场等船 2024-07-22 12:39:33

指定您期望该设备执行的操作非常重要。 它是某种控制应用程序吗? 它必须实现算法吗? 浮点支持怎么样? 图形用户界面? 性能至关重要吗? 您打算使用操作系统吗?

回答这些问题是选择编程语言的关键先决条件。

也就是说,嵌入式系统必须可靠,所以我会选择一些经过测试的解决方案。 C 可能是 ARM 芯片最可靠、最受支持的选项,但 YMMV 取决于您的具体需求。

It's important to specify what you expect this device to do. Is it some sort of control application? Does it have to implement algorithms? What about floating-point support? GUIs? Is performance critical? Are you planning on using an OS?

Answering these questions is a crucial prerequisite to picking a programming language.

That said, embedded systems have to be reliable, so I'd go for some tested solution. C is probably the most solid and best-supported option for ARM chips, but YMMV depending on your specific needs.

任性一次 2024-07-22 12:39:33

C 无疑是嵌入式系统中最常用的语言。
它似乎也是最受关注的语言 http://www.langpop.com/

C is certainly the most used language in embedded systems.
It also seems to be the most talked about language in general http://www.langpop.com/

不及他 2024-07-22 12:39:33

编辑:嗯。 我只是注意到您所描述的“嵌入式”似乎并不是向应用程序添加自动化语言,而是将应用程序压缩到嵌入式平台中。 正如其他人建议的那样,除非您确实需要,否则请跳过可嵌入语言并用 C 语言编写应用程序。除了您实际使用的内容之外,几乎没有运行时开销。

排名不分先后,Lua、JavaScript 和 TCL 都非常适合嵌入。 Lua 对我来说是最容易嵌入的。 Javascript可能是最快的。 这三者都可以很好地处理不受信任的代码,但 TCL 的处理能力最强,例如,不受信任的代码可以运行不受信任的代码(如果它被信任可以执行这么多操作)。

Edit: hmm. I just noticed that the 'embedded' you seem to be describing is not about adding an automation language to an application, but squeezing an application into an embedded platform. As others suggest, unless you really need it, skip embeddable languages and program your application in C. There is nearly no runtime overhead for that, except for what you actually use.

In no particular order, Lua, JavaScript and TCL are all quite well suited to embedding. Lua has been the easiest for me to embed. Javascript might be the fastest. All three have good handling for untrusted code, but TCL's is most robust, for example, untrusted code can run untrusted code (if it's trusted to do that much).

苏辞 2024-07-22 12:39:33

除非您有支持多种替代语言的 RTOS,否则 C 或 C++(取决于您的编译器链)是最佳选择。

Unless you have an RTOS available that supports a variety of alternate languages, C or C++ (depending on your compiler chain) is the way to go.

笙痞 2024-07-22 12:39:33

您的决定很可能取决于该处理器可用的工具。

C 是迄今为止嵌入式处理器支持最多的语言,因此您使用它不会出错,并且如果您将来必须为其他芯片编写软件,这将是很好的经验。

C++ 在嵌入式系统中变得越来越流行。 除此之外,这还取决于您的优先级(上市时间、资源使用、速度)以及您使用的工具的质量。

Your decision is most likely to be determined by the tools avaiable for this processor.

C is by far the most supported language for embedded processors, so you can't go far wrong with that, and it will be good experience if you have to write software for other chips in the future.

C++ is becoming more popular for embedded systems. Beyond that, it depends on your priorities (time to market, resource usage, speed), and the quality of the tools you use.

海风掠过北极光 2024-07-22 12:39:33

C最好的

C the best

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文