Deutsch English Français Italiano |
<vq9di0$2db82$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: Python recompile Date: Wed, 5 Mar 2025 11:46:08 +0000 Organization: A noiseless patient Spider Lines: 73 Message-ID: <vq9di0$2db82$1@dont-email.me> References: <vq1qas$j22$1@gallifrey.nk.ca> <vq1uvb$qbuq$1@dont-email.me> <vq22nc$rvb8$1@dont-email.me> <vq24kd$rg6i$1@dont-email.me> <vq3oag$18iv6$1@dont-email.me> <vq4hf2$1brf7$1@dont-email.me> <vq4l3d$1ck9e$1@dont-email.me> <vq4m0u$1ctpn$1@dont-email.me> <vq4n05$1d5dv$1@dont-email.me> <vq4om7$1dbo2$2@dont-email.me> <vq6dqh$1pskk$1@dont-email.me> <vq6f8p$1pmnk$1@dont-email.me> <vq6gqc$1qcp8$1@dont-email.me> <vq6ips$1pmnk$2@dont-email.me> <vq6j5h$1qosf$1@dont-email.me> <20250304092827.708@kylheku.com> <vq7g1p$1vmg5$1@dont-email.me> <vq8544$23f55$4@dont-email.me> <vq88s7$242vk$1@dont-email.me> <vq8cdq$24hi9$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 05 Mar 2025 12:46:11 +0100 (CET) Injection-Info: dont-email.me; posting-host="8702a54f7d97d70cac41bdb1a2fce454"; logging-data="2534658"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4YT1UpenG5TnmYJJvNj6s" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:t51gF0lChvb40v+NyOxcau8er2E= Content-Language: en-GB In-Reply-To: <vq8cdq$24hi9$2@dont-email.me> Bytes: 4260 On 05/03/2025 02:20, Lawrence D'Oliveiro wrote: > On Wed, 5 Mar 2025 01:20:07 +0000, bart wrote: > >> I maintain my own scripting language. Building it from source - on >> Windows - takes 70ms: > > How wonderful. Does it offer Python-style features? > No, it offers my-style features, that is, things I find useful: * Named constants (known at compile-time so exprs with them can be reduced) * Compile-time enumerations, and parallel tables of enums and data * Jump-table-based 'switch' (this requires those named consts or enums) * Built-in Support for C-style data types, including C-style structs and homogeneous array types * Built-in FFI for C-style APIs * Character constants: 'A' and 'ABCDEFGH' (Python needs 'ord("A")') * Built-in record types with named, mutable members * Pascal-style bit-sets: ['A'..'Z', '0'..'9'] * Bit (u1/u2/u4) arrays * 'goto' * Static local variables within functions * References and pointers * Pass-by-reference * ++ and -- (in Python, ++A is valid but it means +(+A)) * Expression-based syntax (exprs/stmts are interchangeable) * Well-behaved function default parameters (Python's are iffy) * main() functions; if one exists, it is called automatically for top level module * Multi-level loop redo, continue and break * Dedicated endless loops and repeat-N-times loops * Built-in Print and Read /statements/ * 'Swap' operator * Built-in maths functions and constants like 'pi' * Allows any text/binary file to be embedded as a string * Scope control allows selectively exported entities from a module * Expression-based macros * Fast 1.5Mlps bytecode compiler with a built-in feature to create single source file amalgamations of projects * Compact single-file implementation. (This means distributing an app involves two files: the interpreter, and the amalgamated source, and those could be combined. There is also zero start-up delay, compared to find in bundled Python apps) * Fast, brisk contributor that is generally faster than CPython * Shares the same syntax as its implementation language So lots of features I consider fundamental. Python has lots of advanced features but is lacking in the basics like this: print "Enter 2 values: " readln a, b fprintln "# + # is #", a, b, a+b Meanwhile, in Python you can create a class with x, y members, but you can do this: p.x = 100 p.z = 200 You've inadvertently created a new member 'z' (it will be an attribute) on-the-fly. Or this: math.pi = "pie" Or this: def F(): .... F = 42 It is ridiculously and dangerously dynamic.