Nimrod: A New Systems Programming Language
drdobbs.com10 pointsby brihat0 comments
proc main(max_a0: int): int =
var a, longest, len, max_len : int
for a0 in countup(1, max_a0):
a = a0
len = 0
while a != 1:
len += 1
if (a mod 2 != 0): a = (3*a + 1)
a = a div 2
if len > max_len:
max_len = len
longest = a0
return longest
# Main program starts here
echo(main(1000000))
Takes 0.76s (the C program in TFA takes 0.58s) Python 3.3.2+ (default, Oct 9 2013, 14:50:09)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> noel="noël"
>>> noel[::-1] # reverse
'lëon'
>>> noel[0:3] # first three characters
'noë'
>>> len(noel) # length
4
The point is, defining what is a character based on how it is displayed is flawed. Just precompose the string ifg you want and carry on. Like I said in my other comment, making automatic conversion of decomposed -> precomposed wrecks havoc with Indian languages.
Nimrod's gang (including Araq) are very friendly and welcoming.
#julia and #d are very quiet though (except for the bots).
And #emacs -- well, that one channel which is lenient towards off-topic chats!