6 ms·
Req – An HTTP Scripting Language
- kburman 5y agoWhy not use python/ruby?
- seanw444 5y agoThe author said he wanted to build something that incorporated the things he learned while going through some "How to build a compiler in Go" books, not necessarily for anything particularly useful.
- chris37879 5y agoPython and ruby wouldn't exist if more people asked that question. Not all code needs to be a product intended for use.
- spicybright 5y agoCan you clarify? Do you mean python/ruby wouldn't exist if people asked why not use an established language?
- chris37879 5y agoAlways happy to clarify something I was vague about. I get asking that question when you're talking about lesser known tech, but when someone writes an entire language themselves, it's a bit disingenuous to think they don't know about two of the largest languages on the planet. It'd be more reasonable to ask "What advantages does this have over the standard library in python or ruby?". A similar question would be looking at ruby or python and wondering why you should use those when perfectly good ANSI C exists. As to the second part of my statement, I hope that's fairly obvious, but I'll lay it out explicity: Not all code needs to be a product vying for market share to be useful. Some code is for the author to learn from, some code is for making art, some code is for shits and giggles to throw into the world on a lark because someone else might do something with it, or learn something from it, or use it to solve that _exact_ bug they've been having in something just cause they see you did something similar a different way.
- donatj 5y agoI'd say the lack of need of a particular interpreter makes this a lot more portable and usable. A tool written in Python or Ruby will always be most usable by Python or Ruby developers. A tool written in Go and compiled to a single binary has no such barrier to entry.
- alexk307 5y agoNice project, but this is not super useful in practice. HTTP itself is a DSL, so this is another DSL around that DSL. I would definitely choose curl and bash over any other abstraction, and if logic was needed, there are great libraries in every language to do this - requests in Python for example. Sounds like a good learning experience though!
- unfocussed_mike 5y agoI would like to read this, but unfortunately my eyes are in their late forties even if my brain is only 25. Very occasionally I bump up the font size a notch in Chrome to make things a little easier when I am tired. Even HN occasionally. I've not had to bump it up _three_ notches before now. 12px serif body text in 2022? Ouch :-/
- IceWreck 5y agoI had to zoom it to 200% to read on my laptop.
- nojonestownpls 5y agoReader Mode in Firefox is a godsend for this. Instead of click after click on the Zoom+ button (or Ctrl-+), trying to see how many it takes, it's a single click to immediately get things into exactly the font, width, and colour I want.
- unfocussed_mike 5y agoYeah -- I use Safari's reader mode on the iPad a lot. But I have muscle memory for page-zoom on desktop!
- rmbyrro 5y agoYep, 200% zoom needed here
- donatj 5y ago>12px serif body text in 2022 Hacker News, and in fact this comment are 12px. Something's up with this site that's making it extra tiny. Update: Proof - https://jdon.at/ZVirr2 https://jdon.at/ZVirr2
- Arkanosis 5y agoIt's sans-serif, hence the difference. What's extremely interesting is that on my laptop, HN is 12px when Firefox is full screen, but 13.33px when Firefox only uses the left or right half of my screen.
- t43562 5y agoI just started to learn about "Mule" - this makes me think of the language it offers to work with APIs (dataweave) - one might want to be able to have a way for this language to be extended to allow web serving so that one could use it as a way to build new simpler APIs from lower level ones.
- Garlef 5y agoSidenote: The font is very small on this site.
- spicybright 5y agoWas going to say. 12px is way too tiny.
- lbotos 5y agoOn my Mac in FF, HN is 9pt, which ends up being 12px, but it does look larger than the Req site... Oh browsers...
- kroltan 5y agoVerdana (which is what HN uses at least for me) is a much wider font, though. The website uses Fira Sans, which is very condensed (as much as you can without having to stretch the characters, in fact). You can see that the code snippets on the website "look" much larger even though they're also 12px, since they are set in Courier New.
- ushakov 5y agoit’s a neat idea, but useless in a form of a programming language during the pandemic i have started building a declarative (YAML) http client for testing APIs which will integrate into CI/CD like GitHub drop me a line if you’re interested
- linkdd 5y agonot particularly interested, but highly curious to what is a "declarative client".
- bryanrasmussen 5y agoJSON and Rebol https://ross-gill.com/page/JSON_and_REBOL https://ross-gill.com/page/JSON_and_REBOL
- kbd 5y agoOh man, REBOL, blast from the past. If they had open-sourced it early instead of trying to promote a proprietary programming language we might talk about REBOL along with Python and Ruby. Instead, it's forgotten.
- chhickman 5y agoThere has been an open source successor to REBOL called Red[1] for years but progress seems to have been pretty sporadic. [1] https://www.red-lang.org/ https://www.red-lang.org/
- nikeee 5y agoI recently discovered Hurl, which has a similar idea and I think it's great for API integration tests: https://hurl.dev https://hurl.dev
- jamescun 5y agoGreat idea! I have a similar, long forgotten, idea in the projects folder also called "req". Look forward to seeing this develop!
- earthboundkid 5y agoI saw this on Reddit a couple of days ago. Two suggestions: - Change the symbol -> to | because it's more similar to how pipe works in shell than how -> works in C++/PHP. - Introduce a second way to do string literals, so :hello is equivalent to "hello". Then change encode so that its second argument is a string instead of a mysterious name. (Read the docs but didn't actually understand how it worked under the hood. Is it just hardcoded?) So `encode json` becomes `encode :json` (or `encode "json"` if the user prefers). This is a pretty cool project.
- donatj 5y agoI'd be very interested in using this as an embeddable language in a couple of my Go projects. Glancing at the code, seems easy enough. If the Author is around, I'm curious if that'd be a supported use case? The README makes no note.