Programming & IT Discussion

Again, I’m not the most knowledgeable on the language, but I think a lot of it has to do with how Rust deals with ownership and memory management. Generally, established languages follow a few paradigms:

  • Management is the responsibility of the programmer (e.g. C, old C++, still used somewhat in modern C++)
  • Reference counting with removal when the reference counter hits zero (e.g. modern C++)
  • Monitoring and automatic garbage collection (e.g. C#, Java, Python)

The first two are, as we all known, error prone. The last one is less error prone, but the language is slower and may lose some usefulness. It also kind of encourages some really bad memory practices, which often exacerbate its slowness.

Rust, however, takes a different paradigm. It only allows one owner at a time, and you either transfer ownership (move) or allow someone else to use it (borrow). Based on this, you can make certain compile-time guarantees that let you mostly ignore explicit memory management while also not incurring the expenses of garbage collection and reference counting.

Further, Rust has a lot of compile-time memory safety rules that are even more rigid than, for instance, C#. For instance, the compiler will prevent dangling references, a mix of mutable and immutable references to the same object, and multiple mutable references to the same object. All of this effectively catches potential memory bugs at compile time. And while I don’t think dangling references are possible in C# and Java, the latter two problems are still allowed.

Effectively, Rust is a bit more advanced than other popular languages in terms of memory safety, and it managed to do that while still being marketable as a fast language that can be used for systems programming. The fact that its syntax isn’t a nightmare to learn for you average C++ or Java programmer also helps, given that people won’t use your advanced language if they struggle to learn it.

With all that said, though, one can certainly program C#, C++, or Java in a way that holds to Rust’s rules. The main difference is that Rust enforces it. It doesn’t rely on every programmer to do so without fail.

2 Likes

Well, I know plenty of legacy systems that still use them, and I’ve had a couple coworkers who’ve said that their dads always fall back to COBOL when starting a new application. In general, though, it is the Latin of programming: Mostly dead but still sticking around due to legacy reasons.

Either way, no language will be feature-complete at launch. Heck, many established languages aren’t even really “feature-complete” now, and most of have a myriad of third-party libraries they pull in. Even C#, where the mentality has often been to just trust Microsoft, there are still “must-have” libraries like Json.NET and NUnit.

2 Likes

Awesome thread, but is this really the best place to discuss these matters?

Would love to share in some chat with other Catholic programmers, especially around driving MySQL with Perl, PHP or Python to develop some algorithms for “reading” the bible. I cant make up my mind about which one to use right now, but I want to run different versions of ICEL Catholically approved bible translations in concordance with one another and various commentaries.

Some of these bibles are databased already and freely available in a db format online.

I think I should probably start with something like a browseable bible, like on USCCB. Its just their’s is just the one version, and its proprietary anyway.

Just wondering what language I should start with? And if anyone knows where I might find the Dhouey-Rheims translation in an SQL file?

1 Like

welcome, bro (or sis?) !

for your app, i guess it depends on what platform you wanna use, e.g. android or web or stand-alone prog

but i’m assuming you wanna make android / ios app, so i guess you can use Java

cmiiw

1 Like

Are any Catholic Bibles available? I remember looking into this maybe a year or so ago, and I couldn’t find any API or easily-parsable file for any Catholic Bible. I basically concluded that I’d have to web scrape Bible Gateway or some similar site. I started interview around that time, though, so my plans were put on hold.

Your question brings up both interpretive and technical issues. You didn’t specify much, so I don’t know exactly what you’re seeking.

If you’re looking for the NABRE, it could be a bit of a problem. It may be approved for use in public consumption, but there is a copyright issue to be addressed.

http://www.usccb.org/bible/permissions/index.cfm

But - even that said - yes, there are still other approved Catholic Bibles available online.

Here’s a link to the good old Douay-Rheims Bible in a JSON and SQL Format combination.

One hack I am trying to run is out of an old book by Paul DuBois. In the link below, when executed, the code forms a good basis for what I want to do, but he uses the KJV translation. I haven’t looked into DuBois’ table structures to see if it will map to the DRB (above)

http://www.kitebird.com/mysql-cookbook/examples-3ed.php

I’m about to pass out, so I’ll take a look at the DuBois KJV’s table structures and the compare them to the DRB version to see how compatible they are and what changes would need be made.

Any feedback or help would be much appreciated!

God’s Blessings to you!

Wm

Looking at the commit dates, it seems to have just been put up around a year ago. That’s when I was already interviewing, so that might explain why I never found it. :slight_smile:

But, yes, I did account that there are usage restrictions with NABRE and NRSV. With that said, it was mostly for personal use and as a fun project. At most, it would have been turned into a bot for Reddit, though I think it would be fun to write a Twitter bot that posts daily verses and see what kind of tracking you could do on people’s responses to the verses.

From a querying perspective, DuBois keeps things simpler by putting everything in one table. The DRB version would require, at the very least, some joining.

From an optimization perspective, DuBois avoids joining, and he properly indexes the fields that would be getting read. Granted, I wouldn’t expect significant performance improvements here, simply because the database would be really small and fast anyways. Like, the following Python script could read through the whole thing and print the relevant verse in a matter of milliseconds (please forgive two space indenting rather than four):

with open('kjv.txt', 'r') as bible:
  for line in bible:
    li = line.split('\t')
    if 'Jesus wept' in li[-1]:
      print(li)

Opppsss… I think you might have meant me… :slight_smile:

Thank you for the welcome!

And - I’m a Bro, btw…

1 Like

I haven’t read all of the posts in this discussion yet, so please bear with me…

I dont doubt your code snippet would work well, but - fmi - what are we trying to do here? Build a bot of some kind?

What I mean is, once we identify the relevant verse, what are we going to do with it?

It was more just a script for anyone to run to see that performance probably isn’t a huge concern here. I wasn’t trying to do anything with it and probably wouldn’t write a full bot in Python. Well, I guess it depends on how complex the bot is, but Python doesn’t exactly scale well from a maintainability perspective.

2 Likes

you’re welcome, bro…

ofc what I meant is you… haha…

it’s been long time haven’t post anything in this thread coz I gotta lots of things to do :smiley:

so, how’s your project progress?

anyway, here’s a news for gamers and cyber-sec

POC

btw, above posting is for security purpose only

Anyone here familiar with the STEP reader library?

No rush on this topic, btw… I am just throwing some mud on the wheel for a conversation…

What I guess I am trying to figure out about it is how it works/appears… I have eSword, which uses STEP, but I dont quite follow the implementation procedures…

I could be wrong, but it doesn’t look like the USCCB uses it… so I wonder about how it is operating in our interpretations and perceptions of scripture…

1 Like

Rust is created by a communist, but it beats even C in some metrics, which is why Microsoft is switching. So if you want to maintain legacy, and hence a path to the past (closer to where God is), use the C family. But if you’re willing to try state of the art performance and usability languages, try rust. I personally learned C++ back at the end of the 2000’s, and I became overwhelmed with life to where I quit programming for a while and came into the faith. But if I were to program again, I’d deal with Rust.

I’m a video game programmer by the way. I have a bachelor’s in Game and Simulation Programming. If we programmed a game like Europa Universalis IV, but focusing on the aspects of the Holy See, I’d be willing to participate. But we’d have to improve Temple OS to reach maturity in terms of usability so we wouldn’t be heretical. I wonder if a 3D MR desktop experience is heretical or not. Maybe Hindus don’t have a problem with it, but if you mess with reality you mess with God’s Providence. But you could still have the Robud Jesus personal assistant.

Doing something with RISC-V on the horizon for IoT might be fun too. Sprint and SoftBank are hosting an IoT network with a distributed OS to my knowledge.

actually, i just heard about this… but, wasn’t it discontinued? what is actually it will become?

what’s good things in Rust for you so you chose it? coz i actually confused a lot when i saw its syntax, at glance…

The guy who made it died last year after being hit by a train. No one knows if it was a suicide or accident.

As I mentioned earlier, Rust offers a lot of memory safety compared to C++ while still being good for systems programming. As a few examples, this is valid in C++ (though the IDE might warn you about it):

const std::string& GetHelloWorld() {
  std::string s = "Hello, World!";
  return s;
}

The problem is that s will be destroyed at the end of the function, and you’re getting a reference to that destroyed object, meaning that you have a dangling reference. Rust won’t allow that.

This is also valid C++:

std::vector<std::string> v1;
auto v2 = v1;

The problem is that now you have two mutable references to the same vector, which can lead to some unexpected behavior as the two of them are mutating it. Rust doesn’t allow that. This is also valid C++:

char* c = ("Hello, " + "World").c_str();

This is similar to the dangling reference. The concatenated string will be destroyed, leaving c pointing to an invalid place in memory. The program might work, but it isn’t guaranteed to. Rust, to my knowledge, doesn’t have this problem. Finally, this can also happen in C++:

StackObj so;
HeapObj ho = new HeapObj(so);  // ho takes ownership of so and will delete it on destruction
delete ho;

The problem is that the destructor of so will be triggered twice - first on delete ho and second on it going out of scope. Rust doesn’t have this problem.

Those are just a few examples. C++ overall has a lot of pitfalls that haven’t all been fixed by languages like Java and C#. Rust tries to fix them at compile time. Speaking of which, Rust’s compiler is also really good and helpful. While C++ compilers have gotten better over the years, they can still be needlessly verbose.

Chapter 4 in the Rust book goes over more details.

(None of this is to say C++ is a bad language. It’s just got a steep learning curve and many gotchas, some of which are carried over from C.)

Syntax is something you can learn. Structural design flaws tend to be with a language forever unless you’re willing to break backwards compatibility. Syntactically, Java is wonderful, but that doesn’t mean it doesn’t have structural problems it’ll be dealing with for the rest of its life or until Oracle decides it’s willing to break backwards compatibility.

DISCLAIMER: The views and opinions expressed in these forums do not necessarily reflect those of Catholic Answers. For official apologetics resources please visit www.catholic.com.