4 ms·
Show HN: Xoscript
- gabordemooij 9mo ago[dead]
- afandian 9mo agoCongratulations on launching this. I see why you posted the 'history' page first, as it's obviously been a long story! But from a visitor's perspective, I suggest you let the code tell the story. Some code samples on the homepage would be very useful. Especially as, from the syntax, it looks like it isn't just another C-family language.
- gabordemooij 9mo agoThank you, I will do that.
- gabordemooij 9mo agoTo give you an idea how server code looks: https://xoscript.com/docs.xo?chapter=server https://xoscript.com/docs.xo?chapter=server
- gabordemooij 9mo agoHere is an example for server code, just added a minute ago: https://xoscript.com/docs.xo?chapter=examples https://xoscript.com/docs.xo?chapter=examples
- mettamage 9mo agoI’m getting some Smalltalk vibes looking at the examples. Oh, I just read it was mentioned in the history of the project too.
- gabordemooij 9mo agoI know it's probably not for everyone, but yeah I like the general idea of Smalltalk. However, xoscript does not have the whole vm/image thing. Also no classes, just prototypes. So I guess it sits more between smalltalk and js. You can create a class by overriding the new-method of an object though. That will essentially give you a class.
- ddtaylor 9mo agoInteresting to see, Gabor. I don't like the "stop" thing. I think the verbosity can be tuned down a bit in that case, but I understand the small-talk message passing need for "Out write". Am I allowed to use just write "out" instead of "Out"? I assume case sensitivity, but I couldn't find in the docs anything about it. I have used RedBeanPHP for many things and contributed a bit. Thank you.
- gabordemooij 9mo agoOut is used in a static/class-like sense here, hence the uppercase letter. It means it should not be treated as an instance (although it technically does not really matter).
- bddbbd 9mo agoI don't quite get what the language means by being pure object oriented since it seems to support varinle assignment and thus side effects?
- gabordemooij 9mo agoit means there are objects, everything is an object. That has nothing to do with side-effects.
- hnlmorg 9mo agoI’m curious about some of the design choices. Having a period / full stop as the EOL punctuation rather than a semicolon is a nice idea. But personally I think the idea of a line terminator is antiquated. Using square brackets for strings feels superfluous when you have to quote the strings anyway. Was there a reason for this design? I don’t like the “stop” keyword either. Is that doing anything special that the ‘.’ punctuation isn’t already doing? If so, that should be clearer. Using whitespace to reference objects instead of ‘::’, ‘->’ or ‘.’ is also counterintuitive. However at least this is just familiarity issue; at least just so long as tabs and multiple spaces don’t break the method calls. Otherwise you then have an easy way to introduce hard-to-spot bugs. Iteration syntax is weirdly terse compared to the verbosity of the rest of the language. I’m not saying the syntax is bad, but it feel jarring at first when compared to the design choices of the rest of the language. On the positive side of things, it’s nice to see someone experimenting with language syntax. There’s definitely aspects I do like there too.
- gabordemooij 9mo agoI would love to further discuss some syntax issues. - STOP is from telegraphs. \n is also allowed. - The assymetric string boundaries (brackets) allow you to embed quotes/boundaries without escaping. what is terse about the loops? any further thoughts about EOL?
- hnlmorg 9mo ago1. ‘stop’ reads like a change of execution flow (like ‘continue’, ‘break’, and ‘return’) rather than an ASCII control code. I appreciate you’re taking that from telegraphs but I wonder if you’re better off using the control code name (LF) instead? 2. Interesting. Have you got any examples of this? Every example I’ve seen thus far has been [‘string constant’] 3. I might have misunderstood the fizzbuzz example https://xoscript.com/docs.xo?chapter=examples https://xoscript.com/docs.xo?chapter=examples but it looked like the following syntax set up a for-loop as a closure: { :i … } * 101 It was a little surprising because usually with languages that lean heavily into English keywords (eg the Pascal/Algol/Basic derivatives) you’d see these control flows use keywords like FOR. Heck, even C-derived languages do too. Now I’m not saying the syntax is bad. In fact part of me rather likes it. But it definitely surprised me. Similarly the IF conditions surprised me with their tenseness. Though i do like their syntax too. Regarding the fizzbuzz example, why do some conditions have TRUE while others do not. Eg (i = 0) continue. True appears to be implicit. (i % 15 = 0) true: { … ), continue. True here is explicit. Is it because closures require that explicitness?
- inopinatus 9mo agoThe None object represents emptiness, or better still, the absence of information. On occasion, you will receive this object as an answer to a message, in case of the result being nothing. The most essential question you could ask the None object is: None?. The answer will always read True. I came for language documentation, I stayed for the existential crisis.
- publicdebates 9mo agoWow, you weren't kidding > In Xoscript, the meaning of True and False is not fixed. In fact, a Xoscript program gets pretty shaken up over a statement like this: [True := False.] The result of such actions is undefined, however it remains a valid action and therefore formally allowed. Furthermore, there is a Boolean object, which is the root object of both True and False, as both are derivatives of the root object. The Boolean object itself, however, does not provide any practical application.
- gabordemooij 9mo agoIt's a side effect of pass-by-reference. In most languages you have to guess if something is passed by value/ref. In xoscript everything is always a reference.
- deleted 9mo ago[deleted]
- deleted 9mo ago[deleted]
- dang 9mo ago[stub for offtopicness] Reminders from https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html: "Eschew flamebait. Avoid generic tangents." "Please don't pick the most provocative thing in an article or post to complain about in the thread. Find something interesting to respond to instead."
- selfsimilar 9mo ago"The language is intentionally neutral and apolitical, without any stance on social or political issues." I don't applaud or condemn this, but it's strange that it's on the home and history pages. Putting this in a code of conduct document for collaborators might make sense, but on the home page? Maybe I'm the weird one, but for most languages I consider them a tool. So it's like going to the hardware store and seeing a hammer that has a label "This is not a Liberal or Conservative hammer." Yeah, buddy I know. It's just a hammer.
- gabordemooij 9mo agoI was having doubts about this too. But in today's (geo)political climate it might be useful. Otherwise I can always delete it. But you're right, it's just a hammer.
- gabordemooij 9mo agoand.. I want to avoid having to add a coc. Can try.
- pygy_ 9mo ago- Why did you close your eyes ? - So that the room will be empty. Your copy reads as "I'm a radical centrist and will die trying to preserve the status quo". As it usually goes you'd then tolerate hateful, bigoted folks in the name of openness and Free Speech Absolutism™ (which is totally non-political /s) and chase away women, minorities and folks who care about them. If this isn't your intention, a CoC is the way to go. You regrettably can't make hate disappear by pretending it doesn't exist.
- replwoacause 9mo agoI like it. Is this related in anyway to your https://citrine-lang.org/ https://citrine-lang.org/ project? At a quick glance the syntax looks quite similar.
- pfix 9mo agoWhen looking at the git history, that suggests yes, that xoscript is a fork of citrine