[03:25:06] What should the type for morphological functions be? String or monolingual text? Asking the community here: https://www.wikifunctions.org/wiki/Wikifunctions:Project_chat#Type_for_morphological_function [06:39:07] If the function is for English grammar wouldn't it have English as default language for monolingual text? [09:12:49] it might be useful when there's multiple scripts, e.g. a function for serbian could support being given both cyrillic and latin [09:13:09] on the other hand, you now have to decide whether to check the language and what to do if it doesn't match, which makes the function behaviour more complicated [09:17:30] I could imagine having both, one which takes a string and does the actual modification and another which takes monolingual text, checks the language, converts to string, calls the other function and converts back to monolingual text [09:22:14] Or 3? Was just thinking that way! (re @Nikki: I could imagine having both, one which takes a string and does the actual modification and another which takes monolingual text,...) [09:26:09] That reminds me of how there are sometimes 2 versions of a given function in a Lua module with Scribuntu. 1 version is intended to be called from within other Lua modules and just does the actions required on the input. The other is intended to be invoked from wikitext so has to handle extracting the arguments from the frame object and then call the other version of the function [09:26:10] to do the heavy lifting. [14:48:27] Hmmm, having slept over it, we could also have a type "English text", which could community the best of both worlds [14:48:36] And for every other language [15:34:03] Are lexemes from Wikidata going to have simply a type "monolingual text" or a more specific one that could store some of the lexeme's properties? I mean if we pass eg. `{lemma: ..., gender: feminine}` the funtion doing plural (or any grammar transforms) will perform much better IMO. We might have a function accepting strings as well that could try to infer some properties of the phrase given [15:36:12] For English making plurals is relatively simple (in 99% cases just add `s`) but for example in Slavic laguages all the rules are more complex and discarding any potential properties from lexeme just to infer it later seems a bit silly for me. [15:38:55] if you look at lexemes like L1131949, L301993, L615961, and L306451, they contain lots of useful information on them, and so a dedicated type (à la https://gitlab.wikimedia.org/toolforge-repos/twofivesixlex/-/blob/main/tfsl/lexeme.py) would be needed; the form representations (along with values for 'word stem' where they exist, and less often the lemmata) they contain are the im [15:38:56] portant monolingual text values for the functions being asked about [15:46:52] I'm asking because in WF:CHAT I've read: [15:46:52] > 6. but the lexemes in Wikidata will all be coming as monolingual text [...] [15:46:53] So I'm wondering why to limit ourselves to the monolingual text (only lemma without properties) [15:51:18] that specific wording seems like a misunderstanding; ideally functions should exist that take lexeme inputs (such as a future version of Z10037, Z10041, or Z10222) [15:57:57] Yep, my mistake. I was being sloppy. It should be "the representations from the lexemes in Wikidata will be monolingual texts". I'm gonna edit that. (re @Msz2001: I'm asking because in WF:CHAT I've read: [15:57:58] > 6. but the lexemes in Wikidata will all be coming as monolingual text [...] [15:57:59] So I'm wo...) [15:58:52] "the representations of the forms of the lexemes" [21:05:53] python is also able to make network requests, isn't it awesome : https://tools-static.wmflabs.org/bridgebot/620b89f1/file_52017.jpg [21:06:26] . (re @mahir256: yes gzwder is very mischievous) [21:18:00] morse implementation, didn't expect it : https://tools-static.wmflabs.org/bridgebot/bd9d8317/file_52019.jpg [21:20:41] I wish wikifunctions can output image results also [21:22:32] https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2015/Miscellaneous#Collaborative_way_to_generate_SVG.2FPNG_graphs_using_Lua_modules (re @ebraminio: I wish wikifunctions can output image results also) [21:24:28] I just realized, two days later, that I never added an alias to Z10866 [21:24:46] I had put something into the aliases field, then submitted the form, not realizing that I needed to press Enter to actually add the alias [21:25:09] (which also answers the other question I had, “what’s the separator character” – there isn’t one, to add multiple aliases you press Enter several times) [21:33:12] I now have a better appreciation for why the OOUI version of that component turns the input value into an “element”/“value”/“chip”/whatever as soon as the input loses focus… I think I’ve gotten annoyed at that in the past, but silently ignoring an input that looks nonempty seems worse ^^ [21:34:07] should I file a phab task for this? (if it was using Codex, I’d do it, but this seems to be a custom component so idk if it’s planned to be replaced anyway and the task would be wasted time) [21:47:09] Forwarded from Lobste.rs: Beyond functional programming: a taste of Verse. Simon Peyton Jones & Tim Sweeney (https://www.youtube.com/watch?v=OJv8rFap0Nw) [21:47:10] [21:47:11] Comments (https://lobste.rs/s/25n6sw/beyond_functional_programming_taste) [21:47:13] [21:47:14] via pekkavaa@users.lobste.rs (pekkavaa) [21:48:06] a functional logic programming language, maybe something that can be used for the design of wikifunctions (re @ebraminio: Beyond functional programming: a taste of Verse. Simon Peyton Jones & Tim Sweeney [21:48:07] [21:48:08] Comments [21:48:10] [21:48:11] via pekkavaa@users.lobste.rs (pek...) [22:00:05] Yes, don't do this. It shouldn't and doesn't work. Let's delete or change that implementation. (re @ebraminio: TIL python is also able to make network requests, isn't it awesome) [22:00:38] Plus one! I really want that too! (re @ebraminio: wished wikifunctions could output image results also) [22:01:36] I think it's a good idea to file a task. Even if we just end up replacing the component, or if the problem is upstream. (re @lucaswerkmeister: should I file a phab task for this? (if it was using Codex, I’d do it, but this seems to be a custom component so idk if it’s pl...) [22:02:19] To screen or should it be writing a file to disk? (re @ebraminio: wished wikifunctions could output image results also) [22:03:58] (just to note, I didn't implement that one and I never thought about misusing wikifunctions, to me however this number parsing is even more worrisome) : https://tools-static.wmflabs.org/bridgebot/e18c4a3a/file_52022.jpg [22:04:52] just considering as a data type for outputs of functions, I consider function being pure (re @Jan_ainali: To screen or should it be writing a file to disk?) [22:05:14] That's a great question, and we'll need to figure that out when we get there. But it should support the obvious use cases, such as integrating it in Wikipedia, being downloadable, etc. Ideas are welcome! (Maybe collect it somewhere, like [[Wikifunctions:Datatype wishlist/Images]] (I'm making this up) (re @Jan_ainali: To screen or should it be writing a file to disk?) [22:06:01] ok: (re @vrandecic: I think it's a good idea to file a task. Even if we just end up replacing the component, or if the problem is upstream.) [22:06:03] T345301 [22:06:11] (failed at pasting the task ID the first time ^^) [22:06:28] Thanks! [22:07:04] I wish we would wait for the appropriate type to be there before we do this, but why in particular is that worrying? (re @ebraminio: (just to note, I didn't implement that one and I never thought about misusing wikifunctions, to me however this number parsing i...) [22:09:21] I'm worried about seeing community getting used to bad practices can't be extended to different locales, perhaps just an overreact (re @vrandecic: I wish we would wait for the appropriate type to be there before we do this, but why in particular is that worrying?) [22:10:07] Ah gotcha, yes [22:10:52] I meant I won't matter about functions sandbox leak, you indeed will address that but I'm worried more about community getting used to bad practices [22:26:06] Forwarded from Hacker News: *“The days of using untyped languages on non-trivial projects are over.”* [22:26:07] Article (https://github.com/readme/featured/typescript-gradual-types), Comments (https://news.ycombinator.com/item?id=36726316) [22:27:28] in a separate take about this code, guess it was better to promote python types / typescript in the signature users are writing on their code : https://tools-static.wmflabs.org/bridgebot/e7c06ccc/file_52024.jpg [23:13:52] I'm not able to run this implementation, though, because it takes too long and times out. I was planning to make a Wikifunctions implementation of {{Z}} and {{Z+}} (re @ebraminio: TIL python is also able to make network requests, isn't it awesome) [23:15:46] Would something like https://wikifunctions.beta.wmflabs.org/wiki/Z10110 be better? (re @ebraminio: in a separate take about this code (not i18n related), guess it was better to promote python types (mypy?) / typescript in the s...) [23:16:37] yes, except with 'Z6' instead of 'str' [23:16:54] I made it and it's in the sandbox function (I don't remember the ZID) (re @vrandecic: Yes, don't do this. It shouldn't and doesn't work. Let's delete or change that implementation.) [23:17:18] But Z6 maps to str in Python? [23:17:55] ok, but what of annotating for other arbitrary types? [23:19:04] Yeah, that's something we need to work on [23:19:36] Something else: For every function I load, I get a flash of this one first.Why? It should be perfectly possible to serve most of the page content without Javascript – only the right-hand column looks to require javascript : https://tools-static.wmflabs.org/bridgebot/fc3f5a1b/file_52025.jpg [23:20:27] Because we don't have server side rendering available at the Foundation, and having two rendering pipelines would have been expensive [23:20:44] Just a question of resources, unfortunately [23:23:05] If someone wants to start a conversation about adding type hints in Python I'm happy to support it if there's consensus [23:24:29] I don't think Javascript has optional typing? [23:25:49] even wikidata.org *looks* somewhat ok with JS disabled (even if considerably less useful) rather than only displaying the sort of message Jon Harald describes [23:25:52] okay, makes sense. but isn't there an option to make the required javascript load with the page (and not after the page is already loaded), so you don't get that flash effect? (re @vrandecic: Because we don't have server side rendering available at the Foundation, and having two rendering pipelines would have been expe...) [23:27:06] Good point. Would you file a bug? [23:27:30] nope, only TS does (re @vrandecic: I don't think Javascript has optional typing?) [23:27:51] For Wikidata we originally implemented everything to work without JavaScript. (re @mahir256: even wikidata.org *looks* somewhat ok with JS disabled (even if considerably less useful) rather than only displaying the sort o...) [23:28:09] Pity (re @mahir256: nope, only TS does)