How to do "SQL queries" on Dfinity

I heard more than once that MySQL is now dead, after Dfinity. So - if I have tabular-type of data that I had to run SQL queries on previously, how do I do that now, on Dfinity? How do I store the data, and how do I query it?

6 Likes

Hey @groovee! You might find this course on data structures to be helpful, and a few of the repos from one of language researchers, including Motoko CRUD, Motoko Sequence, and Motoko Graph. A community member is also doing some very interesting work with GraphQL. Hope this is a good start! :rocket:

5 Likes

Ummm… will these be of any use until I actually KNOW Motoko? (I’m already familiar with data structures to begin with…)

Btw, the links on the GraphQL page lead nowhere…

Those links came from an older version of the sdk, you’ll find that content (and more) here now: Quick Start, SDK Developer Tools, Motoko Programming Language Guide and Motoko Language Quick Reference

Just dive in with the Motoko learning, run through the course Alexa linked and you’ll pick it up as you go, if you need to clarify anything specific in there just ask!

If you go up a level on the repo you’ll find other courses too: https://github.com/DFINITY-Education

Just to throw in a different idea. If you really want relational data schema and SQL for its succinct query syntax, you can always build Sqlite in Wasm (with memory backed tables not files) and compile your application with it. Not that I’ve tried this, or implying it is easy, but it is something that people have tried in js and browser land.

3 Likes

Umm… to repeat, after GPT-3 and low/no-code dev platforms, is it any point?

It feels naive to think any of these ‘no-code’ platforms will, anytime soon, provide a way to create applications which is both more concise and as maintainable as modern programming languages. Unlike they manage to do that, I doubt they’ll find a lot of adoption in professional software development. It’s the WYSIWYG editors of website design all over again. :wink:

Summing up - there definitely is a reason to learn an actual proper language, still.

5 Likes

I will do exactly jack SHIT. Javascript compiles to WebAssembly just fine (https://www.nectar-lang.com), so where is there a need to learn another language?? What does Motoko have that JS does not?? You wouldn’t happen to be trying to do to the open web what Google did to the smartphone, are you?? (doesn’t help that the Google Wasm guy now works for you). Explain to me how a non-profit is worth $9.5 BILLION, that too, even BEFORE the launch of their damn product?!! If that IS what you’re trying to do, stop now, It Won’t Work. Also, explain to me CLEARLY how hosting on whatever this “canister” is, is different from good ol’ Apache? If it doesn’t let you run one app across 2 CPUs, then what DOES it do?!! Make it long and make it Good. Get started.

1 Like

Thoughts are of course welcome groovee, but please do try and keep the discussion civil in these channels.

10 Likes

Agreed, thanks @Ori! As a reminder @groovee, this forum is first and foremost meant to provide a safe, productive space for developers and community members to collaborate and ideate with one another. More on our guidelines here.

4 Likes

@groovee now back to your actual questions :slight_smile: On Motoko, we fully understand the frustration around introducing and learning a new programming language, but in order to unlock some of the unique capabilities of the Internet Computer, we thought it was helpful to our community of Internet Computer enthusiasts to create Motoko. More on the rationale here: https://stackoverflow.blog/2020/08/24/motoko-the-language-that-turns-the-web-into-a-computer/

On canisters, this video and write-up from the Sodium launch event provides a really great overview of canisters, specifically discussing them as an evolution of smart contracts.

Hope these are a good start and looking forward to continuing the discussion.

6 Likes

Oh, me too - how about that $9.5 billion? I’d like to know that before I watch any videos. Hey - if this thing IS something cool, no one will be happier than me :slight_smile: I’d like to know if this thing has an OPINION on WHAT websites get hosted? (“governance” blah blah…). If I’m buying time on these servers, ALL of which payment goes back to the data centers, then how come I’m not just…paying them directly??

I’d recommend reviewing some of the videos and articles groovee, they do cover a lot of good ground while explaining the various choices made.

Oh, me too - how about that $9.5 billion?

First of all not even sure from where did you get that evaluation. Sentiment? We are all waiting for the mainnet and the token to be released but there’s no need to be that vocal.

Second this is a technical forum but to answer your question about GPT-3 have a look here (also plenty of threads on reddit about this) Will GPT-3 Replace The Coders?. Nowadays, everybody is talking about… | by Maxitech | Medium from a beta tester.

Q: Do you think GPT-3 will replace the coders?
A: No, the work that most engineers don’t want to do will be replaced. When I copy and paste code from Stackoverflow to build an authentication flow for Google accounts, I always question why I am doing this in 2020. Millions of people do the same thing.
What will happen is that 90% of the boring tasks will be done very fast. However, like any engineer, who reads this, knows that the devil is in the details and in the last 10%.
Soon engineers will focus on the real details and do more creative work. As a result of this trend, general software will be further commoditized and subfields will continue to emerge.
This trend of developers concentrating on more value-added work started about a decade ago. The number of low-code and no-code products have increased significantly in recent years. Their software production capability has also improved. We expect GPT-3 to accelerate this trend.

Dfinity is not some state of the art super machine but they have one of the best teams of devs in the world and I’m pretty sure they’re using what’s best at this point in time. Maybe in the future AI will replace all coders but I think we’re pretty far away. Also Dfinity solution to replace in memory persistance (not talking about orthogonal persistance but that’s not new as well) is not new (check neo4j ) In order to store it/query it you can use an DAG Directed acyclic graph - Wikipedia and some patterns for search like in cypher query language.

I’m working on this for a separate project but @matthewhammer is working as well. It’s the link @alexa.smith posted above. eg: Motoko-Graph

No offense but I can tell you’re not a seasoned developer based on your questions on this forum. Each and every programming language have been created with a special purpose to solve one or many issues others couldn’t but it’s not like NASA is going to trust (not soon anyway) an AI for a big project.

In some sense I agree there are way too many programming languages around but you don’t have to learn all of them. If you have some experience behind you it won’t take long before you can grasp the basic concepts of a new one (unless you move from OOP to functional, in that case maybe a bit more longer huh)

As @morrolan said it’s WYSIWYG all over again. They’ve been on the market for plenty of years now and it’s not like companies are firing devs to use those platforms.

2 Likes

Perhaps you could say more about the (JS?) programs that you’d like help running in Wasm (e.g., as a canister on the IC)? (regardless of whether you’ve done any aspect of that Wasm compilation already, with NectarJS or not.)

Personally, I’m less interested in any one language as much as I am in human-(computer)-human communication. Motoko and Candid are simply tools to facilitate this communication, and (hopefully) help streamline human-to-human communication over the Internet Computer in the future.

Admittedly, I’m not familiar with NectarJS, but their page seems to admit that the solution may in fact still be a WIP and unfinished itself (“NectarJS is not finished yet and need more development.”?)

Motoko is very young, and there is much left to do, but it already compiles into Wasm that runs on the IC platform. If you can already compile your JS into Wasm somehow (with NectarJS or something else), that’s what matters. The Motoko language is happy to call, and by called by, any code that can do that once all are deployed onto the IC. As you may know, we use another simpler, common language (Candid) to describe data between calls on the IC, each being something that compiles to Wasm, but perhaps not Motoko. Motoko is not meant to be the only language, but just one of many. JS is welcome, too, of course.

1 Like

What I would like to KNOW, instead of the stuff above, is that once all web becomes Dfinity, whether Motoko will be the only language we can write for that web in. Which might become Pay, and Costly, at any point!!! THAT is what I would like to KNOW. Not the 101 pluses and minuses OF the thing.

Can someone answer my question on this thing having an opinion on what sites get hosted, please?

The answer is no, Motoko is not the only language.