Code Monkey home page Code Monkey logo

Comments (10)

soupi avatar soupi commented on July 30, 2024 1

Running try-purescript without a local backend

  1. Switch to the gh-pages branch
  2. Use an http server to serve try-purescript (example: python -m SimpleHTTPServer or http-server -p 3000)
  3. Open your browser at http://localhost:8000 (or whichever port you used to serve) and you should see the try-purescript app

Running try-purescript with a local backend

Use the Haskell Stack build tool to build the backend:

  • Clone the repo
  • Run stack build (you might also need --install ghc)

Install the core try-purescript packages:

(cd staging/core && psc-package update)

You might need to change the version in psc-pacakge.json to the current compiler version installed on your machine (for example: "set": "psc-0.10.5")

After that you can run the server with:

stack exec trypurescript -- 3333 staging/core/.psc-package/psc-0.10.4/*/*/src/**/*.purs staging/core/src/TryPureScript.purs

You will also need to change the endpoint for core to point to your local backend:

  1. Switch again to gh-pages
  2. Change this line to:
 endpoint: "http://localhost:3333",

or similar

Actually, it will be easier to just clone the repo twice and keep one branch on master for the backend and one branch on gh-pages for the frontend.

Hope this helps.

from trypurescript.

lazywithclass avatar lazywithclass commented on July 30, 2024 1

Thanks for the tip and for the help, really appreciated @soupi :)

from trypurescript.

lazywithclass avatar lazywithclass commented on July 30, 2024

That's great! So I don't really need a server, I could host the static files on S3 or the likes and go from there.

Thank you so much for this @soupi, is it already written somewhere or what about adding it to the README?

from trypurescript.

soupi avatar soupi commented on July 30, 2024

What is your use case? we might be able to help more if we knew what you are trying to do :)

I can PR this if @paf31 wants it.

from trypurescript.

lazywithclass avatar lazywithclass commented on July 30, 2024

Ah yes sure! So I'm at Recurse Center (https://www.recurse.com/), me and a fellow recurser with Haskell experience are trying to come up with an online interactive website that could teach fundamental principles of functional programming in a typed language, for newbies like myself :D

So the idea is to have some theory explaining a subject, a few exercises followed by an input in which they could evaluate their answers, we would use the local version of try.purescript.org to evaluate the answers. That's one of the goals of our batch here, we are evaluating different solutions and one of those is PureScript.

from trypurescript.

soupi avatar soupi commented on July 30, 2024

Good luck! If you have further questions on PureScript specifically you might want to ask in IRC/Slack/Reddit/Mailing list where it'll get better exposure.

Also, you might also want to check Code World as well as you might have similar goals :)

from trypurescript.

lazywithclass avatar lazywithclass commented on July 30, 2024

@soupi I forgot about to ask (and sorry if this is not the best place), if it's ok to make calls to try.purescript.org to get back results in our project, which is all about learning functional programming using PureScript.

We don't expect to hammer it at all, both because we won't be showing the project a lot in the beginning and both because we call the endpoint on a specific key combination, not on onchange.

Please let me know your thoughts, and thanks again for your efforts on PureScript!

from trypurescript.

soupi avatar soupi commented on July 30, 2024

Best to ask @paf31 this kind of question :)

from trypurescript.

paf31 avatar paf31 commented on July 30, 2024

@lazywithclass Go for it :) Please let me know if you expect the usage to increase a lot, but for moderate use, that's what it's there for.

from trypurescript.

lazywithclass avatar lazywithclass commented on July 30, 2024

@paf31 that's great thanks! Yes, I will definitely come back if our project grows in terms of usage.

from trypurescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.