trealla-js
notion-sdk-js
trealla-js | notion-sdk-js | |
---|---|---|
9 | 22 | |
33 | 4,608 | |
- | 2.0% | |
8.4 | 6.4 | |
9 days ago | 9 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
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.
trealla-js
- The Power of Prolog
-
Using Prolog in Windows NT Network Configuration (1996)
I think Prolog really shines as an embedded query engine (I know this is old and it's been removed since). It's perfect for declarative configuration, very easy to write powerful queries once you wrap your head around it.
The Yarn constraints plugin also used (Tau) Prolog, although it looks like it's in the process of being replaced with JS, which makes me a bit sad. The reasoning is here: https://github.com/yarnpkg/berry/issues/1276. Seems like the biggest issue is lack of a nice dev environment. I maintain the Trealla Prolog Wasm port (npm package 'trealla') and I hope some day to use it for a VSCode extension or LSP or something to provide a nice dev experience. Performance has also been cited as an issue[1] but Trealla is quite fast and I expect it could easily handle a complex Yarn workspace with tons of facts. If this sounds like something you'd be interested in helping me with, feel free to contact me or make an issue/discussion here: https://github.com/guregu/trealla-js
[1]: https://github.com/yarnpkg/berry/issues/4079#issuecomment-10...
-
How do I learn system programming?
port a C or Rust project to wasm and make a JS package for it (trealla-js is an example of such a package, porting a C Prolog interpreter to wasm)
-
PHP: Prolog Home Page
Hey, this is mine. Thanks for submitting it. I'll answer some questions.
> Why?
I ported Trealla Prolog to WASM (WASI) and I was looking for something useful to test it against. I found Spin, which can run WASM+CGI, and landed on this. Making this project exposed a number of bugs in my port that have now been fixed, so consumers of more useful projects[1][2] benefit as well. Also, PHP style templates are just fun! There's something valuable to just being able to shove a little bit of code inside some HTML and get it up on the internet.
I started my webdev journey with PHP many many years ago, and it's nice to revisit it from a different perspective. I don't use the real (elephant) PHP anymore, but I've gained a newfound appreciation for how fun its quick & dirty development style is.
I hope this project can serve as an example of how to use Prolog for fun things. It does showcase some of the cooler dynamic aspects of the language, and the PHP parsing code is like 10 lines of DCG.
> Is it a joke?
Yes and no. The name is certainly a joke. I was pondering what 'Prolog on Rails' might be and thought calling it PHP would be funny. This led to the PHP-style templates which were quick to implement and pretty powerful. Despite the humorous presentation, it does actually work.
> Can you use Prolog for web services?
Yes! For example, SWI has a mature HTTP package: https://www.swi-prolog.org/pldoc/doc_for?object=section(%27p.... It's used to power SWISH, an online Prolog code sharing thing: https://swish.swi-prolog.org/
> Next steps?
I would like to support persistence somehow. I think it'd be really cool if you could use Prolog's dynamic database[3] as a persistent store. Spin has components for Postgres and Redis so it shouldn't be too hard to implement, but I lose the WASI compatibility if I do that... which means I can't use the binary from WAPM, etc.
I would also like to experiment with running Trealla on Cloudflare Workers. I have another project, worker-prolog[4], which uses Tau Prolog (a Prolog written in Javascript) on Workers.
On a somewhat related note, I've also been playing around with Cosmopolitan libc[5]. I got Trealla to compile to an APE executable but there's some issues with the embedded Prolog libraries getting garbled, so I need to improve my GDB skills and figure out what's going on there.
Finally, I'd like to say thanks to Andrew Davison (@infradig on GitHub), the author of Trealla Prolog, for letting me add WASM support to his project and helping me with lots of things. For example, PHP led to Andrew implementing improvements for using DCGs to parse Prolog terms, which is now super fast[6]!
[1]: https://github.com/guregu/trealla-js
[2]: https://github.com/trealla-prolog/go
[3]: https://www.swi-prolog.org/pldoc/man?predicate=assertz/1
[4]: https://github.com/guregu/worker-prolog
[5]: https://justine.lol/cosmopolitan/
[6]: https://github.com/trealla-prolog/trealla/issues/53
-
Prolog at work
With trealla-prolog/go on the backend and trealla-js on the frontend, you can share the same validation code.
-
Why Would Anyone Need JavaScript Generator Functions?
I found async generators to be handy while porting a C Prolog interpreter to WASM/JS. A `for await` loop is a natural way to iterate over query results, and as a bonus you can use `finally` within the iterator to automatically clean up resources (free memory). There are ways for determined users to leak (manually iterating and forgetting to call `.return()`) but I've found that setting a finalizer on a local variable inside of the generator seems to work :-). I can't say manual memory management is a common task in JS but it did the trick.
The generator in question, which is perhaps the gnarliest JS I've ever written: https://github.com/guregu/trealla-js/blob/887d200b8eecfca8ed...
- trealla-js: Trealla Prolog for the web
- The Ciao System
- Trealla Prolog for the Web
notion-sdk-js
- Show HN: Pages CMS – A CMS for GitHub
- Regarding notion api
-
Convert HTML To Notion Blocks
Here is an example of how to create a new page in your Notion workspace with the blocks converted from the original HTML. We use the @notionhq/client library and you'll need to have a valid Notion API key and database ID:
-
I created an open source library (notion-on-next) that makes building a Notion-powered Next.js App super easy. It automatically generates types and scaffolds your app to match your database properties!
Provides data fetching functions that add some utility to the notion-sdk
-
Helping Your Users Write Simpler API Calls With "api" ✍️
Thousands of great APIs run their developer hubs on ReadMe, where our customers are already documenting every little detail about their API using the OpenAPI Specification. This got us thinking: “the OpenAPI Specification already provides a ton of valuable information about an API, what if we use this to generate an SDK that’s as good as Notion’s JavaScript SDK”?
-
For developers out there using the API, is there a way to trigger a GET request by typing on Notion, and not the other way around?
The official guide actually suggests to poll all the time and compare to local DB to imitate webhooks.
- Why Would Anyone Need JavaScript Generator Functions?
-
Does a Notion extension exist that will populate a Notion table with my Reddit submissions like this?
Here are the links if you need them JavaScript https://github.com/makenotion/notion-sdk-js
-
NotionPyMail - Triggers Email when value in database is changed
Hey, I created a Notion automation in Python that sends an Email to a given recipient when the value of a select property in a Notion database is changed. To send the Email, the SendGrid API is used. I inspired myself at the official Notion node.js implementation.
-
Understanding SEO and Web Vitals for your NextJS site and how to improve them?
Go To Documentation
What are some alternatives?
ciao - Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
notion-api-server-demo - This application shows the demo code for the tutorial on building using the Notion API.
async-generator - Async generator module.
twan-dev - Always wanted to use Notion as your CMS? Well, now you can! [Moved to: https://github.com/twankruiswijk/Blion]
Bumble - A small JavaScript game framwork
fastify-auth - Run multiple auth functions in Fastify
trealla - A compact, efficient Prolog interpreter written in plain-old C.
dotenv - Loads environment variables from .env for nodejs projects.
pyswip - PySwip is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface.
fastify - Fast and low overhead web framework, for Node.js
php - Prolog Home Page
dotenv - A Ruby gem to load environment variables from `.env`.