• 0

Looking for a scriping language with a tiny footprint


Question

Hey guys. I'm currently looking for a scripting language with a tiny footprint (less than 3KB RAM and a binary that when compiled is less than 20/30KB).

All I need is the ability to evaluate statements similar to first order logic.

For example: !(x : X | x > 5)

Would mean that "for all x in the set X, return true if all xs are greater than 5, otherwise return false".

I need the ability to define functions that would return these sets (The ability to define X and pass parameters to that function that returns a set).

It would also need to be able to support a limited form of structures, where an attribute could be obtained on a certain variable (eg. x.count).

As for data types, integer, floating point and sets are about all I need. Anything else would probably be ripped out to save space.

It needs to be written in C and the ability to compile on old versions of GCC (3.4.x) would also be useful.

Anyone got any ideas? Ideally I don't want to have to write this myself.

4 answers to this question

Recommended Posts

  • 0

Your requirements are quite strict and I'm not sure that this suggestion meets them completely, but it sounds like you are describing close to the ideal use case for bc, the arbitrary precision calculator language. You can download the source code for the latest version from the GNU Project Archives and read the man page on die.net.

Edit: Although BusyBox does not include bc, you could probably accomplish what you are looking for using the combination of sh, awk, and grep it includes, albeit much less elegantly. BusyBox also gives you the option of selecting features at compile time, so you could choose not to include features you don't need.

  • 0

I'm using this on an embedded system, so it lacks anything like sh, awk or grep. There isn't really an OS... my code gets compiled when the OS code gets compiled.

This also means that there is no notion of running different executables, so no ability to run sh, awk or grep. (At least the platform gives support for proto-processes, or pseudo-processes or whatever it calls them)

Thanks for bc, I'll have a look into it.

Its a shame that if I do have to write it myself, I can't even use bison or flex because of code size issues.

  • 0

If this is for a proprietary system where you can't use GPL'd code, you can try the FreeBSD implementation of bc instead of the GNU version I linked to in my last post. Its less featureful than the GNU version, but that may not matter, depending on how much of the functionality you actually need. (And, most importantly, its BSD licensed.)

PS: I feel your frusturation with limited ROM space for embedded development. I have hit the limit on the PIC18F242 and ATMEGA328P many times.

  • 0

GPL code is perfectly fine for me, its all for academia so there shouldn't be an issue.

Anyway it looks like our team is just going to implement a small language. We've already got a small vm working, just need to finish the lexing, parsing and compiling.

This topic is now closed to further replies.
  • Posts

    • Looks like no official TBW rating, which should be a required listing in my opinion for sites like Amazon (hell, put it on the box too.)
    • I think I understood the article fine. Online password managers open users up to more possibilities of getting hacked, and due to KeePass being offline and local it reduces the idea of getting hacked. If someone chooses to put their database online they're kinda missing the point. With regards to the idea of the on-prem idea, I would have two issues. I'm not sure about the first issue, but I wouldn't be surprised about them offering a cloud storage for the passwords that most wouldn't bother to switch off, regardless of if they went for on-prem or not. The second issue is that the on-prem solution for Bitwarden costs money, whereas KeePass is free and open-source (as far as I am aware). The article points out how to sync the database between devices, and I recognise that deficiency in security. But it isn't a necessity. So both services can offer a same idea, but one is free and the other isn't...choices, choices.... But to each their own.
    • AB Download Manager 1.9.2 by Razvan Serea AB Download Manager is an open-source, feature-rich download manager designed to accelerate downloads, organize files efficiently, and provide seamless control over downloads. With support for multiple connections, resume capability, and an intuitive interface, it enhances the downloading experience for users seeking speed and reliability. The software integrates with various browsers, enabling quick link grabbing and batch downloading. It supports HTTP, HTTPS, and FTP protocols, ensuring broad compatibility with different file sources. Users can schedule downloads, set speed limits, and categorize files automatically for better organization. AB Download Manager is lightweight yet powerful, making it a great alternative to proprietary download managers. Its open-source nature allows developers to contribute, customize, and improve the software as needed. Whether you're downloading large files, managing multiple downloads at once, or seeking an ad-free experience, this tool offers a practical and efficient solution. Key features of AB Download Manager: Multi-Connection Support – Accelerates downloads by splitting files into multiple segments. Resume Capability – Allows paused or interrupted downloads to be resumed without starting over. Batch Downloading – Supports downloading multiple files at once for improved efficiency. Browser Integration – Captures download links directly from browsers for seamless operation. HTTP, HTTPS, and FTP Support – Ensures compatibility with a wide range of file sources. Download Scheduling – Enables users to automate downloads at specific times. Speed Limiting – Lets users control bandwidth usage for optimized performance. File Categorization – Automatically organizes downloaded files into designated folders. User-Friendly Interface – Simple and intuitive design for easy navigation. Cross-Platform Compatibility – Works on multiple operating systems. Ad-Free Experience – No intrusive ads or tracking for a clean user experience. AB Download Manager 1.9.2 changelog: Added New Twilight theme (#1292) Optional download completion notifications on Android (#1290) Fixed Fixed a crash on some older CPUs on Windows Fixed oversized system tray icon on macOS Improved Updated translations Prevented Android devices from sleeping while downloads are active (#1291) Various UI and UX improvements Download: AB Download Manager 1.9.2 | Portable | ~80.0 MB (Open Source) Download: ARM64 | Portable ARM64 | Android Links: AB Download Manager Website | Github Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I am not surprised because life is the product of a lot of biochemical and physical processes that releases various energies as a by-product. The only thing new here is the detection of these photon emissions. The researches noted this "glow" is not a metaphysical one. They don't even immediately end when one is dead. Things like fires, light bulbs, and on a bigger scale stars release a lot more "light" and they are hardly alive.
  • Recent Achievements

    • Conversation Starter
      sumytbe earned a badge
      Conversation Starter
    • One Year In
      B4dM1k3 earned a badge
      One Year In
    • One Year In
      DarkWun earned a badge
      One Year In
    • Dedicated
      Almohandis earned a badge
      Dedicated
    • Dedicated
      JuvenileDelinquent earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      516
    2. 2
      +Edouard
      186
    3. 3
      PsYcHoKiLLa
      87
    4. 4
      Michael Scrip
      79
    5. 5
      Steven P.
      73
  • Tell a friend

    Love Neowin? Tell a friend!