Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: February 2, 2025, 10:37 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PicoBlaze Simulator in JavaScript
#71
RE: PicoBlaze Simulator in JavaScript
(August 23, 2022 at 2:33 pm)FlatAssembler Wrote:
bennyboy Wrote:Free hosting is bullshit.  I hate it.
What makes you say so?
I say so because free hosting of sites involving data access (uploading or downloading media, etc.) are horribly slow and unreliable-- or, I should say, they were when I attempted to put my first small business website online. The experience of using "free" sites was so traumatizing that I pulled out my wallet and signed up for a Microsoft VM-- quite expensive, but fast as hell and always works perfectly. It's different when you are a student, though. I get it.

Quote:So, how is Firebase different from GitHub Pages? I watched the video and I failed to understand what does one gain by using FireBase instead of GitHub pages for WebAssembly.
I couldn't tell you. As I said, I've seen these things around, but have not used them, as I use Azure services exclusively.

Quote:I already have a static-file hosting service, that is GitHub Pages, I want to build and deploy a back-end, so that people can share and comment on their own PicoBlaze programs.

You don't need to be stuck with one app or one framework or physical system.  If you want something more active, then use a static site (i.e. the one you already have) and write an API in whatever language, using whatever framework, you want, for the dynamic content-- so long as your free host will allow you to pass data in and out, you can bypass all the ads and other BS.

A typical API will be very small: usually taking in JSON, parsing it, and making a SQL query to save or update data-- or making a SQL query and sending it out as JSON.  Your main site doesn't really care where that JSON data is coming from, as they are decoupled.
#72
RE: PicoBlaze Simulator in JavaScript
bennyboy Wrote:I say so because free hosting of sites involving data access (uploading or downloading media, etc.) are horribly slow and unreliable
I don't mean to upload or download media. I mean to upload and download small text files.
bennyboy Wrote:A typical API will be very small: usually taking in JSON, parsing it
The list of examples is already stored in as JSON, it is fetched and parsed as this:
Code:
fetch("https://flatassembler.github.io/PicoBlaze/examples.json")
    .then((response) => {
      if (!response.ok)
        throw new Error(response.status);
      else
        return response.text();
    })
    .then((jsonFromGithub) => {
      const examplesArray = JSON.parse(jsonFromGithub);
      let examplesHTML = examplesArray
                             .map((example) => `
    <div class="exampleCodeLink" onclick="fetchExample('${example.file_name}')">
      <img
        src="${example.image}"
        alt="${example.image_alt}"
      />${example.name}
    </div>
        `).join("") + `
    <div class="exampleCodeLink" style="display: flex">
      <div class="callForMoreExamples">
      Maybe you'd like to try <a href="https://flatassembler.github.io/Duktape.zip">my examples of x86 assembly</a>,
      that <a href="https://flatassembler.github.io/AEC_specification.html#HowToCompile">AEC compiles</a> to?
      </div>
    </div>
    <div class="exampleCodeLink" style="display: flex">
      <div class="callForMoreExamples">
        Have some example you would like to add here?
        <a
          href="https://github.com/FlatAssembler/PicoBlaze_Simulator_in_JS/issues"
          >Contact me on GitHub</a
        >!
      </div>
    </div>
    <div style="width: 1px; flex-shrink: 0">
      <!--
          Because, apparently, CSS ignores the right-margin on flex
          elements that cause overflow.
     -->
    </div>
      `;
      document.getElementById("examples").style.justifyContent = "initial";
      document.getElementById("examples").style.alignItems = "initial";
      document.getElementById("examples").innerHTML = examplesHTML;
    })
    .catch((error) => {
      document.getElementById("fetchingExamples").innerHTML =
          "Failed to fetch the examples JSON from GitHub: " + error;
    });
#73
RE: PicoBlaze Simulator in JavaScript
(August 24, 2022 at 7:18 am)FlatAssembler Wrote:
bennyboy Wrote:I say so because free hosting of sites involving data access (uploading or downloading media, etc.) are horribly slow and unreliable
I don't mean to upload or download media. I mean to upload and download small text files.
I wasn't explaining why YOU shouldn't use free hosting. I was explaining why I don't have any experience doing what you are doing-- because I already have a paid server.

Quote:
bennyboy Wrote:A typical API will be very small: usually taking in JSON, parsing it
The list of examples is already stored in as JSON
Fine.  So you should easily be able to use a free server site to store examples either by inserting into a .json file, creating multiple files, or saving them to a mySQL database, and reveal CRUD methods through an API-- which you should be able to call from JavaScript in your static files site.
#74
RE: PicoBlaze Simulator in JavaScript
[Image: RTm8LVs.jpeg]

Boru
‘I can’t be having with this.’ - Esmeralda Weatherwax
#75
RE: PicoBlaze Simulator in JavaScript
@BrianSoddingBoru4

That lady's Eve's Apple is quite large.
#76
RE: PicoBlaze Simulator in JavaScript
(August 25, 2022 at 3:59 am)BrianSoddingBoru4 Wrote: [Image: RTm8LVs.jpeg]

Boru
Isn't posting such off-topic comments against the rules?
#77
RE: PicoBlaze Simulator in JavaScript
(August 31, 2022 at 7:12 am)FlatAssembler Wrote: Isn't posting such off-topic comments against the rules?

Yeah, seemed kind of rude and inappropriate to me, too.
#78
RE: PicoBlaze Simulator in JavaScript
(August 31, 2022 at 11:13 am)bennyboy Wrote:
(August 31, 2022 at 7:12 am)FlatAssembler Wrote: Isn't posting such off-topic comments against the rules?

Yeah, seemed kind of rude and inappropriate to me, too.

I mean, the comments complaining about me supposedly asking for help with my homework are not answering the question, but are at least slightly on-topic. This is just completely off-topic.
#79
RE: PicoBlaze Simulator in JavaScript
I have started a Reddit community about PicoBlaze: https://reddit.com/r/PicoBlaze
Let's hope I will be able to manage it.
#80
RE: PicoBlaze Simulator in JavaScript
What do you guys think, why was Firefox not allowing me to `fetch` the JSON list of examples from `raw.githubusercontent.com` (which is why I had to copy that JSON from my GitHub profile to my website in order to be able to fetch it from my PicoBlaze Simulator), but it allows me to `fetch` the `.psm` files from `raw.githubusercontent.com`? I have asked an Information Security StackExchange question about that.



Possibly Related Threads...
Thread Author Replies Views Last Post
  A weird bug in the preprocessor of PicoBlaze Simulator in JavaScript FlatAssembler 81 10158 December 19, 2023 at 4:46 pm
Last Post: BrianSoddingBoru4
  Reformatting tools for JavaScript FlatAssembler 0 467 June 14, 2020 at 10:13 am
Last Post: FlatAssembler
  Anatomy of religion in RELIGION SIMULATOR game gravitysoftware 12 3468 February 8, 2015 at 12:52 pm
Last Post: c172
  Analysis of a Facebook social engineering/Javascript "hack" Autumnlicious 4 3540 March 2, 2011 at 9:29 am
Last Post: fr0d0



Users browsing this thread: 1 Guest(s)