Facebook SDK

Recent Posts

test

Show HN: Pith language. JavaScript with a little bit of Python syntax https://ift.tt/hs2iroK

Show HN: Pith language. JavaScript with a little bit of Python syntax I've been writing a lot of JavaScript and Python lately. I like Python's syntax, so I created a language called Pith that's JS with some Python-like syntax (but without trailing colons). It's not a full compiler. It really just does search-and-replace, but I find it fun and useful in spite of some sharp edges. I use it on my smartphone to write and run short programs. Here's an example using the HN API: max = 6 ids = await getApi('topstories') for id in ids.slice(0, max) getItem(id) async def getItem(id) const d = document.createElement('div') results.appendChild(d) d.style = 'padding-bottom: 1em;' i = await getApi('item/' + id) ? i.title, '|', i.score u = '//news.ycombinator.com/item?id=' d.innerHTML = i.title.link(u + id) async def getApi(path) u = '//hacker-news.firebaseio.com/v0/' return getJson(u + path + '.json') https://ift.tt/NVWKEPR September 2, 2022 at 12:17AM
Show HN: Pith language. JavaScript with a little bit of Python syntax https://ift.tt/hs2iroK Show HN: Pith language. JavaScript with a little bit of Python syntax https://ift.tt/hs2iroK Reviewed by Manish Pethev on September 02, 2022 Rating: 5

No comments:

If you have any suggestions please send me a comment.

Flickr

Powered by Blogger.