librope VS programming-with-ada

Compare librope vs programming-with-ada and see what are their differences.

programming-with-ada

A guide for learning about the Ada Programming Language. (by pyjarrett)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
librope programming-with-ada
4 8
265 18
- -
0.0 6.7
over 2 years ago over 1 year ago
C Python
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

librope

Posts with mentions or reviews of librope. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-03.
  • Show HN
    3 projects | news.ycombinator.com | 3 Dec 2022
  • The case against an alternative to C
    9 projects | news.ycombinator.com | 8 Aug 2022
    Yep. A few years ago I implemented a skip list based rope library in C[1], and after learning rust I eventually ported it over[2].

    The rust implementation was much less code than the C version. It generated a bigger assembly but it ran 20% faster or so. (I don't know why it ran faster than the C version - this was before the noalias analysis was turned on in the compiler).

    Its now about 3x faster than C, thanks to some use of clever layered data structures. I could implement those optimizations in C, but I find rust easier to work with.

    C has advantages, but performance is a bad reason to choose C over rust. In my experience, the runtime bounds checks it adds are remarkably cheap from a performance perspective. And its more than offset by the extra optimizations the rust compiler can do thanks to the extra knowledge the compiler has about your program. If my experience is anything to go by, naively porting C programs to rust would result in faster code a lot of the time.

    And I find it easier to optimize rust code compared to C code, thanks to generics and the (excellent) crates ecosystem. If I was optimizing for runtime speed, I'd pick rust over C every time.

    [1] https://github.com/josephg/librope

    [2] https://github.com/josephg/jumprope-rs

  • Why Is C Faster Than Java (2009)
    8 projects | news.ycombinator.com | 26 Dec 2021
    > it’s not clear if this will be a positive for native dev advocacy

    I've rewritten a few things in rust. Seems pretty positive to me, because you can mix some of the best optimizations and data structures you'd write in C, with much better developer ergonomics.

    A few years ago I wrote a rope library in C. This is a library for making very fast, arbitrary insert & delete operations in a large string. My C code was about as fast as I could make it at the time. But recently, I took a stab at porting it to Rust to see if I could improve things. Long story short, the rust version is another ~3x faster than the C version.

    https://crates.io/crates/jumprope

    (Vs in C: https://github.com/josephg/librope )

    The competition absolutely isn't fair. In rust, I managed to add another optimization that doesn't exist in the C code. I could add it in C, but it would have been really awkward to weave in. Possible, but awkward in an already very complex bit of C. In rust it was much easier because of the language's ergonomics. In C I'm using lots of complex memory management and I don't want to add complexity in case I add memory corruption bugs. In rust, well, the optimization was entirely safe code.

    And as for other languages - I challenge anyone to even approach this level of performance in a non-native language. I'm processing ~30M edit operations per second.

    But these sort of performance results probably won't scale for a broader group of programmers. I've seen rust code run slower than equivalent javascript code because the programmers, used to having a GC, just Box<>'ed everything. And all the heap allocations killed performance. If you naively port python line-by-line to rust, you can't expect to magically get 100x the performance.

    Its like, if you give a top of the line Porsche to an expert driver, they can absolutely drive faster. But I'm not an expert driver, so I'll probably crash the darn thing. I'd take a simple toyota or something any day. I feel like rust is the porsche, and python is the toyota.

  • Rust is now overall faster than C in benchmarks
    9 projects | news.ycombinator.com | 3 Jan 2021
    > I have no idea whether that matters or even easy to measure...

    It is reasonably easy to measure, and the GP is about right. I've measured a crossover point of around a few hundred items too. (Though I'm sure it'll vary depending on use case and whatnot.)

    I made a rope data structure a few years ago in C. Its a fancy string data structure which supports inserts and deletes of characters at arbitrary offsets. (Designed for text editors). The implementation uses a skip list (which performs similarly to a b-tree). At every node we store an array of characters. To insert or delete, we traverse the structure to find the node at the requested offset, then (usually) memmove a bunch of characters at that node.

    Q: How large should that per-node array be? A small number would put more burden on the skip list structure and the allocator, and incur more cache misses. A large number will be linearly slower because of all the time spent in memmove.

    Benchmarking shows the ideal number is in the ballpark of 100-200, depending on CPU and some specifics of the benchmark itself. Cache misses are extremely expensive. Storing only a single character at each node (like the SGI C++ rope structure does) makes it run several times slower. (!!)

    Code: https://github.com/josephg/librope

    This is the constant to change if you want to experiment yourself:

    https://github.com/josephg/librope/blob/81e1938e45561b0856d4...

    In my opinion, hash tables, btrees and the like in the standard library should probably swap to flat lists internally when the number of items in the collection is small. I'm surprised more libraries don't do that.

programming-with-ada

Posts with mentions or reviews of programming-with-ada. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-08-25.
  • yet another Ada web site?
    8 projects | /r/ada | 25 Aug 2022
  • Is it worth it to learn Ada in 2022? And how do I learn it?
    4 projects | /r/ada | 7 Jun 2022
    I wrote up a bunch of stuff about it
  • May 2022 What Are You Working On?
    12 projects | /r/ada | 1 May 2022
    I am writing an article for Programming with Ada showing how to send an IMCP using just the Ada standard library and writing your own bindings to C. This is a port of program I wrote in C++.
  • Request for comments: an idea for a central repository of knowledge and resources for Ada
    7 projects | /r/ada | 25 Mar 2022
    I have one already for my own Ada notes, but it doesn't autogenerate. Sphinx allows arbitrarily complex tables, while also providing the ability to generate the documentation and keep it locally, which would be important for people on isolated/proprietary/military networks. It would be interesting to have a site generated by a crate in Alire, so you could download and run it locally as needed.
  • How to get into the Ada world
    1 project | /r/ada | 7 Feb 2022
    There's also: - http://learn.adacore.com - https://pyjarrett.github.io/programming-with-ada/ - https://en.wikibooks.org/wiki/Ada_Programming - The video's not available yet, but this might be useful: https://fosdem.org/2022/schedule/event/ada_outsiders_guide/
  • What Did You Work On in 2021?
    15 projects | /r/ada | 30 Dec 2021
    I also did a few things: - Wrote an online e-book about Ada - Septum - context-based source code search for multi-million line codebases (I use this nearly every day at work. It's being submitted as my Ada crate of the year. - dir_iterators - library similar to the incredible walkdir. - project_indicators - library for spinners and progress bars. - trendy_terminal - library for cross-platform terminal setup, VT100 support, and GNU readline-like behavior. - trendy_test - library for simple unit testing, which runs tests in parallel. - Ada Ray Tracer - an Ada port of Ray Tracing in One Weekend. - dirs_to_graphviz - Make graphviz files from directory trees. - rst_tables - a tool to draw RST table outlines.
  • Why Is C Faster Than Java (2009)
    8 projects | news.ycombinator.com | 26 Dec 2021
    > say, Ada programmers.

    I stand summoned.

    > Unfortunately, none of them ever seem to show up.

    We do from time to time, but people assume our language is dead (it isn't). I learned it last year and I've been very impressed by how simple it is, given the speed you get with it.

    It was a "big language" at the time, but now it's a language smaller than Rust or C++ which offers good performance with straightforward syntax.

    Ada has inline assembly, easy usage of compiler intrinsics, dead-simple binding to C, built-in multi-tasking (which includes CPU pinning), a good standard library, RAII, and real honest-to-goodness built-in, not-null-terminated strings. It's a compiled language, so you get good speed in general, but the built-in concurrency really does help work which can be split up. Ada 202x is getting even finer grained parallelism (parallel for-loops) in the language itself to even further help this.

    - https://learn.adacore.com/

    - https://github.com/pyjarrett/programming-with-ada

    - https://en.wikibooks.org/wiki/Ada_Programming

What are some alternatives?

When comparing librope and programming-with-ada you can also consider the following projects:

c2rust - Migrate C code to Rust

Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).

mu - Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.

python-cheatsheet - Comprehensive Python Cheatsheet

c3c - Compiler for the C3 language

Ada_GUI - An Ada-oriented GUI

proposal-explicit-resource-management - ECMAScript Explicit Resource Management

sdlada - Ada 2022 bindings to SDL 2 - Don't STAR this, this is my personal repo which I may delete over using the AGF one.

jumprope-rs

ada_language_server - Server implementing the Microsoft Language Protocol for Ada and SPARK

buffet - All-inclusive Buffer for C

Honki-Tonks-Zivilisationen - Der Code meines 4X-Rundenstrategiespiels. The Code of my 4X turn-based strategy game.