[Question]
  [
When we publish some software, we assign a version number to it. And users may want to update to the latest version of some software. So, it is the time to find out which version should be newer.
### Input
Input two version numbers as strings.
In the context of this challenge, we only support version numbers which are some digits joined by dots.
* A version number is a non-empty string which may only contain digits (`0` ~ `9`) and dots (`.`).
* Dots would not be the first / last character of a version number.
* There must be some digits between dots. No two dots may appear continuously.
* All numbers in a version number would be less than 216.
### Output
Compare the inputted version numbers and output whether first one is greater than / equals to / less than the second one. You are allowed to choose one of the following presentations:
* Use positive number / zero / negative number, while zero means equal;
* Use three constant distinct values;
### Comparing
You are not required to implement the algorithm described in this section. Your submission is valid as long as it result the same output with this algorithm.
* Version numbers are some decimal numbers joined by dots. We first split the two version numbers to arrays of numbers;
* Padding the ending of arrays with zeros to make them have same length;
* Compare from the first item to the last one:
	+ If the two array items different, the greater number means greater version number
	+ If they are the same, continue to compare the following items;
	+ If all items in the array are equal, the two versions are equal.
### Testcases
```
version1  version2  result
2         1         >
1.0.0     1         =
1.0       1.0.0     =
1.2.42    1.2.41    >
1.1.56789 1.2.0     <
1.10      1.2       >
1.20      1.150     <
18.04     18.4      =
7.010     7.8       >
1.0.0.1.0 1.00.00.2 <
00.00.01  0.0.0.1   >
0.0.1     0.1       <
42.0      4.2.0     >
999.999   999.999.1 <
2018.08.1 2018.08   >
```
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~84~~ ~~79~~ 76 bytes
```
lambda*l:cmp(*map(lambda v:map(int,v.split('.')+[0]*len(`l`))[:len(`l`)],l))
```
[Try it online!](https://tio.run/##fZDhasMgFIX/7ymE/biahYtKupjQ7kXaQtOtZQWTSRsKffpMo7FJsy4Y8Fw/z/Uec2u/fxrZHVebTlf1/qtKdPlZG5rUlaG@Qq6lE6emTa94MfrUUkBgb2u@TfShoTu9Y2xdDtttqhnrzNny5EhBAglfSkBEwV4JfMBLxARy5PAntppicHeLd@aYxKzv3GNW9JbzpgIX77kqIGB3t@UUC109Bs9GkGNMLJ64KeRZnFSh389GyJGLGEiOCv7JDV0sPhDuloTHpr7ObQoW4/4OzN2GOvGYGDUdu2VDUg7LJrmN3YqiQPtDjwVhPR/dJHeRKHtisSCGt3W/ "Python 2 – Try It Online")
Outputs `-1,0,1` for `<,=,>`
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~15~~ ~~14~~ 13 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
'.¡0ζε`.S}0K¬
```
Outputs `-1 [] 1` for `< = >` respectively.
-1 byte thanks to *@Emigna*.
[Try it online](https://tio.run/##MzBNTDJM/f9fXe/QQoNz285tTdALrjXwPrTm//9odUM9Az1DIDRQ11EAcQz0jIDsWAA) or [verify all test cases](https://tio.run/##VY5BCsIwEEX3nqJ0M5syzITEJqtuRBCXLktBBY/h1gN4A/fd6gF6gB7Ci0STmViEBP5/@T98cqczXyK77W7T1dX7dq/qLgJOD5pf8/OIhyvtpzE2sQcDTQUMw6oHRkL6s9lkKsCglXxSJcXo1q0PhZcsa9uUrnp2mvBINiOPNpMWSUot@mUQLjsoHflPNHF6IYkJzypDAdZI3f6mhRDwexNUqVFDaZPXX9XB8AE).
**Explanation:**
```
'.¡              # Split on dots
                 #  i.e. ['1.0.1.1.0','1.00.2.0']
                 #   → [['1','0','1','1','0'],['1','00','2','0']]
   0ζ            # Zip, swapping rows and columns, using '0' as filler
                 #  i.e. [['1','0','1','1','0'],['1','00','2','0']]
                 #   → [['1','1'],['0','00'],['1','2'],['1','0'],['0','0']]
     ε   }       # Map each:
      `          #  Push both values to the stack
       .S        #  And calculate the signum (1 if a>b; -1 if a<b; 0 if a==b)
                 #   i.e. [['1','1'],['0','00'],['1','2'],['1','0'],['0','0']]
                 #    → [0,0,-1,1,0]
          0K     # Remove all zeros
                 #  i.e. [0,0,-1,1,0] → [-1,1]
            ¬    # Then take the head as result
                 #  i.e. [-1,1] → -1
```
[Answer]
# [R](https://www.r-project.org/), 32 bytes
```
rank(numeric_version(scan(,"")))
```
[Try it online!](https://tio.run/##bZLbaoQwEEDf/YoheVGwQxLcqtDdx/5EKUVEW2kbi7r7@3ZyMeq6wcBkPDkzDg4zf73qeup6Xf3ArRlGiqDtB5iacer0JzzB9NXAm3yHboT@z5FRe4bW34tvyVDp71hff5uhqz@8hNIJp2vzw5djXek4ZSxJkpkpIQsUBUoGS8yiiAMokEDLtHMxZ4knu33ubHNEueNLBFEb1zFTLAUmyQ2HxUlkGYkCBUsfYZzEC2MIS95RG0ZhpixGwc62qUVNP@dF6bGNjVPXC@OKqUNDG49yjDzdN7R6aHqZgQrMDozvOUdhi@VYHL9rOx8MExDm8a2FWi4rJCHC4UEXPC5tAHms5T2ZsmWy/Wj2nrIskTZhPlp9wbP@R2n4jwJzmf8B "R – Try It Online")
Using an R builtin
Outputs `1 2`, `1.5 1.5`, `2 1` for less, equal, greater.
---
Best so far, without builtin :
### [R](https://www.r-project.org/), ~~151 142 125~~ 107 bytes
```
function(v,L=strsplit(v,'\\.'))Find(c,sign(Reduce('-',Map(as.double,Map(c,L,Map(rep,0,rev(lengths(L))))))))
```
[Try it online!](https://tio.run/##bZDLioMwFIb3PkXQhRHSQxJsVRgL3czKmcWsu@lo7Aii4qWvb2OSeqkTFE/C5/efnHbM4zEfqrQv6go/SBJ3fds1ZdHLjXu9gut5n0WV4ZR0xb3CPyIbUoHdg0u@bg2@dZDVw28p1C4lifq2oiGUtOKBS1Hd@78OJ55Zo4MQQ3ndorPloO@LKmNZHvTph4WsHKfY5jZBNrM9D@2WI/9VDAMK1Cb/YY6UvpiJUOQbtWI4@FxhstjYVlkMjqcgjAy2sjmy6xejw/iuoZWHa4Yd3xtaPCFQf4JC8HeM6TkAqsICCPf3Ws8H5gnQ6TGtzVn6lDKJUI3PutmjjyeA7bOMx@cqxt@OZuuJogjkKzFTLb7Zw@l0@1DlmXphzuMT "R – Try It Online")
Unrolled code with explanation :
```
function(v){             # character vector of 2 elements as function arg;
  L=strsplit(v,'\\.')    # obtain a list of two character vectors
                         # with the separated version numbers;
  R=rev(lengths(L))      # store in vector R the lengths of the 2 vectors and reverse it;
  M1=Map(rep,0,R)        # create a list of 2 vector containing zeros
                         # repeated R[1] and R[2] times;
  M2=Map(c,L,M1)         # append to the vectors in list L the zeros in M1;
  M3=Map(as.double,M2)   # convert the character vectors in M2 to double;
  w=sign(Reduce('-',M3)  # compute the sign of element by element difference M[[1]] - M[[2]]);
  Find(c,w)            # returns the first non zero element in w, if none return NULL;
}
# N.B. as.double is necessary because "0XX" is interpreted as octal by strtoi unless 
#      we use strtoi(x,10) which is exactly the same length of as.double(x)
```
Outputs `-1`, `NULL`, `1` for less, equal, greater.
---
Original concept, golfed down using `sapply`, `[<-` and `%*%`:
### [R](https://www.r-project.org/), 129 bytes
```
function(x,y=strsplit(x,"\\."),w=sign(sapply(y,function(x)strtoi("[<-"(rep(0,max(lengths(y))),seq(x),x),10))%*%c(1,-1)))w[!!w][1]
```
[Try it online!](https://tio.run/##VZDRioMwEEXf9yvSLIXJkg5JSFeF9S/2zfZBRFvBVde4WL/eTaLUFBKYe@6d0cmwVOlS/bXFWHctPPicmnEwfVOPVtDLBSnjU2rqWwsm7/tmhpnvcWbDY1cDzb5OFIayB8F/8gc0ZXsb7wZmxhg35a9NcnukYOz4cSxA8pO01pQdDtM1k9elggKoopxQSRl781KiQEH5K3Ha850p1MpjW4RZiefPKE42K@yQ6xgVDlmRPAe5GIV2NEb9hBEK3x1hbBkh7@T7XpKhzE3XkqobyPYiuVs22AOf/y7c2T@9aiGtKdbgbnnl@M608nP0y0ZJkqC9lm9V0KCE2yP2g7baess/ "R – Try It Online\"Split on `.` Make both the same length (which pads with `NA`). Convert `NA` to 0 and coerce to integers with `strtoi`. (And the base has to be included or things like `\"010\"` are treated as octal.")
Now you have a list of two equal-length vectors of integers. Calculate the pairwise differences using `Reduce` and output the first non-zero element using the tricky little `w[!!w][1]` form at the end.
Outputs `-1`, `NA`, `1` for less, equal, greater.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~18~~ 17 bytes
*1 byte saved thanks to @Adám for using `⍤1` instead of `∘↑(...)¨` and by changing the input format from a nested array to a matrix*
```
(⍋-⍒)(⍎¨∊∘⎕D⊆⊢)⍤1
```
[Try it online!](https://tio.run/##ZU5LCsIwEF17kjZghySkNtl7kYLUTUG3XqCUSsUKgmtx0XP0KHORmDafRoRMeJ@ZxyvPdXa4lPXpqHWFzT3F/pph/yAG3KYR2w7bF96ee@wa7N4E@w/TGpuhMmYzTGOabhOeEPOzhJDNTBlQoH@SFazlRQ7C3c4w2maQ7wqpghfdMJ/EoxyvsXzdlECFlSUIrxZAXUAB8qcwRB3p/EK@pZQtLrW7wbNkQUEU3EWJuLpSCswshsPrCadzX@myHDPmFw "APL (Dyalog Unicode) – Try It Online")
Takes the input as a matrix of chars as the right argument, where each version string is on its own row. Outputs `¯1 1`, `0 0`, `1 ¯1` for `<`, `=`, `>` respectively.
`(⍎¨∊∘⎕D⊆⊢)⍤1` on each row
* `∊∘⎕D⊆⊢` group all occurrences of digits, that is, split on `.`
* `⍎¨` and convert each of these occurrences to a number
`↑` convert to a matrix, where the first input is on the top row and the second one in the bottom, padding with `0`s where necessary
`(⍋-⍒)` and
* `-` subtract
	+ `⍒` the indices into the rows which would sort them in descending order
	+ `⍋` same as the top but for ascending order
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~63 47~~ 22 bytes
```
{"v$^a cmp v$^b".EVAL}
```
[Try it online!](https://tio.run/##XY/RaoMwFIbv8xQHGUPZOD0JaY2oZbvY3e4Gu7EObFEY1FWqDIrYV3dJY8K2YODjy5/jn64@Hzdze4H7BvJ5DL7vPio4tB1o2Af48v78Os0p04Gnoe6HHnI4fn7VPbZVF454OLX7cLV7e1hFU5Qy1pzOLjgygL66QBNiQeUjFryMrsFuCK5YiDJl0yzALe5pyzgS0j@bG@uy/txYgVJYq4m7CRzXm1glN2uzmbHkJohffxPe8rXPKiRprULpOsRIy4gY1d@@aPrpTeYTeoIl0o3Int@yjox1r8uYdCVB@r5bliQJ6q15IX0jY4JMN6V5IZP9AQ "Perl 6 – Try It Online")
Turns out that Perl 6 has a [version type](https://docs.perl6.org/type/Version) that pretty much fits the description. This is an anonymous code block that takes a list of two version strings and returns either `More`,`Same` or `Less`.
### Explanation:
```
{                    }  # Anonymous code block
 "             "        # Create a string of code
  v$^a cmp v$^b         # Comparing the two versions
                .EVAL   # And EVAL it
```
## Or, without built-in types for 47 bytes:
```
{first +*,[Z<=>] map *.split('.')[^@_.ords],@_}
```
[Try it online!](https://tio.run/##XY/dioMwEIXv8xRDL1ptZZoEWxV/8B32bq1bursKglYx3ixiX91Nqgm7DRk4fHNmctIVfX2emx/YlhDPY1n1YoDD3sneozjJobl1sEfR1dVg7XBnZx/pFdv@W@ROep3UXDoUYhAQQ13dC4FywBrxq20@rePl7XC0Jzsk4qZ9ISFl2@uhkQCoXmlhRnMHMGO5/dhchs0DM56HZJo56MOMSghDivSFxopqr@krytHlC5WK6Q0MT2fPD5508UaKUr2B/3mNG8pOxusjdRfqo6szeEjXFR76//OiyieLqsvlhkVRmYgu/adXK0X17yLi6pDgmrwJCYIAZUm9KjkREU5VNl/qVSnvLw "Perl 6 – Try It Online")
Anonymous code block that takes two strings and returns `More` if the second is greater, `Less` if the second is smaller and `Nil` if they are equal.
### Explanation:
```
{                                             } # Anonymous code block
                 map *.split('.')          ,@_  # Split both strings by '.'
                                 [^@_.ords]     # Pad the lists by a lot
          [Z<=>]   # Zip the strings with the <=> operator
 first +*,  # Get the first value that when coerced to an int, is not 0
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~49~~ 40 bytes
```
+0|{~c[H,".",T]hị;T|ị;0|0}ᵐz{h-0&t↰₀|h-}
```
...It's still rather unimpressively lengthy.
Expects a list of two strings. Uses `positive number / zero / negative number`
as `> / = / <`.
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/X9ugprouOdpDR0lPSSckNuPh7m7rkBoQaVBjUPtw64Sq6gxdA7WSR20bHjU11GTo1v7/H61kYKAHQoZKOkpACggNlWL/BwEA "Brachylog – Try It Online")
## Explanation
**Splitting the inputs**
Given an input that does not unify with `[0, 0]`, such as `["1.02.0", "1.2.0.1.0"]`, the below segment outputs, e.g., `[[1, "02.0"], [1, "2.0.1.0"]]`.
```
                            # unify the input with...
+0                          # : a list whose sum = 0 (output is 0)
  |{                     }ᵐ # : OR a list that when mapped...
    ~c                      # : : if the input string unifies with a list of the form...
      [H,".",T]             # : : : e.g. "1.02.0", H = "1", T = "02.0"
               hị           # : : : coerce the head to an integer
                 ;T         # : : : append the string T
                            # : : : "1.02.0" -> [1, "02.0"]
                   |ị       # : : OR it unifies with an integer
                     ;0     # : : : append 0
                            # : : : "1" -> [1, 0]
                       |0   # : : OR it unifies with 0
                            # : : : 0 -> [0]
```
**Comparing the inputs**
Given, e.g., `[[1, "02.0"], [1, "2.0.1.0"]]`, zips the sublists into `[[1, 1], ["02.0", "2.0.1.0"]]` and compares the values in the head (`[1,1]`). Recur on the second sublist. Note that the zip predicate `z` cycles through shorter lists so that zipping with `[0,0]` is equivalent to zipping with `[0]`, hence the previous step unifies `0` with `0` without further values appended.
```
z             # zip the sublists
 {          } # unify the result (r) with...
  h           # : take the head of the result
   -          # : : subtract the second value from the first
    0         # : : if the difference unifies with 0...
     &t↰₀     # : : recur on the tail of r
         |h-  # : OR unify with the difference of the elements of the head
              # : (equivalent to returning early)
```
[Answer]
# JavaScript (ES6), ~~73~~ 68 bytes
*Saved 5 bytes thanks to @redundancy*
Takes input as `(a)(b)`. Returns \$0\$ for *equal*, a positive integer for *greater than* or a negative integer for *less than*.
```
a=>b=>(a+[...b].fill`.`).split`.`.some((x,i)=>d=~b.split`.`[i]-~x)*d
```
[Try it online!](https://tio.run/##hZDRboIwFIbv9xTkXLXbPLZNHZCsvIgxEQRMF2bNMItXvjprKYJTqwSSnvTr35/vK//N282P3h9mO1NWXa26XGWFykj@tkTEYoW1bpo1rim2@0Yf7Apb810RcnzXVGWlOhXjzlKvZqcjfS27jdm1pqmwMVtSExAQDQ8lwKeBRvN5lL1c0RwZMgjQ6g4NU/Z0NEQLlH0dOgz9BcEmHBcfcZLCQF9mf96hhyqehid/KS5pvnicnSCTo5MEJTxyEiPjo8EYE3juG51Hb5C5V0Cgid9mVpulmT8KwezzduRp/q/JTbY8G3a0vPJ9k52mKdoPenoY7A2BbMGcw8QB4zD17v4A "JavaScript (Node.js) – Try It Online")
[Answer]
# [Java (JDK 10)](http://jdk.java.net/), ~~201~~ ~~96~~ 89 bytes
```
java.util.Comparator.comparing(java.lang.module.ModuleDescriptor.Version::parse)::compare
```
[Try it online!](https://tio.run/##bVNNa@MwEL33VwyGELukg2zSxnGaXnavPRX2UnLQOnKqrL@QZMNS8tuz@nKd2gsWHs1782YGzZxpTx/Oxz9XXrWNUHDWd@wUL7Ho6lzxpsb73V3b/S55DnlJpYRXymv4vAPgtWKioDmDX0xITf3RVC0VXDYOtwzIrZOFb0rw@gQlK9QK/EXw04eKdpp70cdnkYoq/esbfoRK5/KR7weg4iQjLz1P2c88@@vYjnNT1Qh0FWnJ0MIlrU9YNceuZPhqfz@ZzAVvDdenyTIdIVmUZb6d685WMZSmi1NMKgl7Xx7AJwRJsIIgDuCyGn0xEiTOP3Fbp0UnAQmunZKxZnIxPj5t0u1AmEXHXjiZyXogfpzGpEjWFktx/R3aIHF6G0z/0xeObRDzTXI6J4kNhTj@hGBdFp0g68Qpr@ctbrdb1Meg3pwGJ8S0lDppfwnsyOnBcw9ZNGKcM/OUmXvQ6Os93/5KxSpsOoWt5qkiDBYxkbDIYfGgjUWt1U3MOzms/NSbKQxnc4nDSnyxrREfomg0XVkXvxp@J/IPKm6lzX71Q4m8gLCHZyARCKY6UcPyebm7gV5uoRcPDff90q3h5foP "Java (JDK 10) – Try It Online")
Returns a negative number if the first version is smaller than the second one, a positive one if the first version is greater than the second one and `0` if they're equal.
Yep, that's some heavy work to "just" call a built-in!
## Credits
* -14 bytes, thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)
[Answer]
# [Python 2](https://docs.python.org/2/), 87 bytes
```
lambda*p:cmp(*zip(*map(lambda x,y:(x or 0,y or 0),*[map(int,u.split('.'))for u in p])))
```
[Try it online!](https://tio.run/##XZHbboMwDIavt6fIXRIUWSFKR0CjL8K4YKvQIhUatbQqe3mWExlMysmf/Tu2bObp@zKKpa8/lnM3fJ66zFRfgyHZj7bH0BkSMHqyuSJPdLkizmZ/UZY1LkCPE7vDzZz1RDBgSnvrvSM9ItNSShdn3tjEHg41DRaYIZy744hbhhqcAweeYJ2gR6svYQEyZHCvfZocDm@FKlev170nZ8wndhIRaX7YRSvg0jsUyM3vBfCQpgD1vwH4q5i7JTb5AuG@Wh6CN/JkxyuKZOxArq3E8LIswW5H4nMnE9xVrwKLRlS31euLudp5@XkQXB8x9Ho8kQdlPbHMTmv5BQ "Python 2 – Try It Online")
Outputs -1,0,1 for <,=,>, respectively.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 54 bytes
```
\d+
$*
+`^(.)(.*=)\1
$2
(.*=|^=.*)1.*
<
.*1.*=.*
>
\.
```
[Try it online!](https://tio.run/##LU3RCsIwDHzPXwgKXQchKZ1ridOf8HGMCfPBFxHx/2vSDpLcJXdcvs/f6/0oJ3dfcftoT2Xeejh66NfFYefQT93McAywuNuBO93RM3q4QEXd4AozQilBGBgJqaFUrixgVMnA7ozDeUy5HkxlMwazGeFBbwkpis4II5LqI6YWjHssWQVoSCzURKhTjEUNl1hf5JxRW3ZUMZC9SGrd2R8 "Retina 0.8.2 – Try It Online") Link includes test cases. Uses the separator value as the equality output, so for convenience the header converts the input separator to `=` but it could be anything not in `[.\d]`. Explanation:
```
\d+
$*
```
Convert to unary.
```
+`^(.)(.*=)\1
$2
```
Repeatedly delete the first character from each side until they differ or one side runs out. This is much faster than trying to match prefixes, although possibly not golfier. At this point, the strings are in one of several forms, which need to be decoded to a comparison result.
1. If neither string contains a `1` then the result is `=`
2. If the left string starts with a `1` then the result is `>`
3. If the right string starts with a `1` then the result is `<`
4. If the left string is empty then the result is `<`
5. At this point the right string is empty so the result is `>`
Another way of thinking about this is that if one string contains a `1` and the other does not start with a `1` then that string is greater, however that turns out to be a byte longer.
```
(.*=|^=.*)1.*
<
```
Check for case 3, or case 4 without case 1. 
```
.*1.*=.*
>
```
If the left string still contains a `1` at this point then it is greater.
```
\.
```
Otherwise delete any left over `.`s.
# Firefox Browser Console REPL, 19 bytes
```
Services.vc.compare
```
I believe this internal function performs the required comparison. It returns -1, 0, or 1.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~140~~ 134 bytes
This code outputs a negative, `0` or a positive for `<`,`=` or `>` respectively.
```
i;n;p;q;g(char*s){for(i=n=0;*s&&++n&&*s-46;i=i*10+*s++-48);i=i;}f(char*a,char*b){for(p=q=0;*a+*b&&p==q;b+=n)p=g(a),a+=n,q=g(b);a=p-q;}
```
[Try it online!](https://tio.run/##bVLLboMwELznKyykUIzBshFJiBznJ3pMORhUUgvF4ZGeIr6d@kFoSItAuzuzM9jaLeNzWY6jZIo1rGXnoPwSXdjDe3XtAskVJyzsfR8h5fthH6dbJrkMKUFhj1CcZtDUbKicTkQ2FE7e8NbIBQoL3284b1mBuIINPwcCRkLnUavzAjLBm7hlw2jUoLxemnd5VoFUNyAhuK@AfmQVyAOBAHSft@9OgbfDG5sJzjXzIPgTcXxWHDUxrFbG9iKkCh7W9sxAnPJTkgM@gQDcvcSLPOoN0QxQTDD5BzSQpRZwglPrYJIXBcWb7S7bT@yLjjq/5MXNoXSz7M4wSQ2R4fQZ32FibXY4@3MBPJ@YmHfxHwcRqnniehesBQy1gNPEGqavV9nv91h/mpqypSwh5vSZdQRT8eAHN0M3SD2w2tVmrWq9VPWBbhhCNZyn5drM7ugRVoE41fmJ5JGNNIdsbms63VgF3pqSHqxLYOKH8iLwkPwuoEngRMwew2oYfwA "C (gcc) – Try It Online")
# Edits:
* Saved 6 bytes thanks to ceilingcat !
[Answer]
# [Ruby](https://www.ruby-lang.org/), 75 bytes
```
->a,b{c=d=0;c,d=[a,b].map{|f|f.slice!(/\d*./).to_i}while''<a+b&&c==d;c<=>d}
```
[Try it online!](https://tio.run/##XZHhaoMwFIX/@xSujNpu7jYJ6YyY@CJdGZpUJlgqtmOM6rO7G2NkmyRw/O7J9cTbfZbfY6XGl7yIy7tWRpFMx0Yd8PUI56K991VfwbWp9elhs3szT7Dbwu3yXg9fH3VziiJZPJfrtVbKZFqq3AzjioX@oYvKAwoEyD@qLPXepW4pA84cRUV9Bwr710SkE3VeaSnxHdivr7GF0v3iFUC4owK4z5AAmVskIP7mBZsPN7GLYQenCCYirj55vbLU304G3IcM@ZI3D9I0BdyoZ4UnZMCIzSZQz8p6V3Btm/q2ecR/Ps2i63EusVbdXIjCaJu14UHH1TSx4zD@AA "Ruby – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~105~~ ~~88~~ 80 bytes
*-17 bytes from @redundancy. Wow!*
*-8 bytes removing Math.sign. Thanks @tsh*
Returns a negative, zero or positive value
```
f=(a,b,r=/(\d*).?(.*)/)=>a+b&&+((a=r.exec(a))[1]-(b=r.exec(b))[1]||f(a[2],b[2]))
```
[Try it online!](https://tio.run/##jZHfboMgFMav3VMYLxpo9QiETrxwe4Q9QNcLsNpsaWpj22UXfXcnf5olQmwTIEB@3zkfH9/yR57r/ut0yY7drhmGtkIyVWlf5ehzt8TwjmCJc1y9yZVaLFYIyaqH5repkcR4Q7cZUvcLZS5utxbJDdumalwwHurueO4ODRy6PWpRwpI0TmiCcRxFUZ7HH9fT9RLTlwlGgQAJoiSAGtAoHsMMuPWgd676nA8K69dClHcJmSiykMQZYk88kzmWrp@oLIBwgwvgIz370gKI9VGAmLDhtOE/SKKHdj/nxlKEag2xBR6laSHDe//qN@DMGuKB2D24LEsYp@bd1rPjd2BERyqsJ3eYNhr@AA "JavaScript (Node.js) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~16~~ 11 bytes
*-5 bytes from @Shaggy*
Outputs:
* negative number for `<`
* (`null` or `0`) for `=`
* positive number for `>`
---
```
N®q.Ãy_r-Ãf
```
[Try it online!](https://tio.run/##y0osKPn/3@/QukK9w82V8UW6h5vT/v9XMtQz0jMxVOKCMIyUuHTTAQ "Japt – Try It Online")
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), ~~116~~ 111 bytes
```
import StdEnv,Text
?s=map toInt(split"."s)
$a b= @(?a)(?b)
@[h:t][u:v]|h==u= @t v=h-u
@l[]=sum l
@[]l= ~(sum l)
```
[Try it online!](https://tio.run/##JYrBCoJAFEX38xUPa6GQUi2Dhy5qIbQIaicuXqYpzIzivBkKok9v0uJuzj33VrIm7VV/s7IGRZ32nRr6keHMt4N2q0v9YJEaVDQA97nm0Ayy4yAJTCSWBFeELEwpCtNrJLKi3XFZ2J0rXy2inTYGh21sRSaLEo1VIKdXKRHe4a9F/sw0sliA2wBCsEnWc4JZbH9ixkZPuBQ4w/RzW/@pGkl34@P86PdPTaqr/uUkiZt@VF8 "Clean – Try It Online")
Outputs a negative number when the first argument is less than the second one, zero when they're equivalent, and a positive number when it is more than the second one.
[Answer]
# [Swift 4](https://developer.apple.com/swift/), 155 bytes
### Header (not counted: the code is non-recursive):
```
let f:(String,String)->Bool? = 
```
### Code
```
{let x:(String)->[Int]={$0.split{$0=="."}.map{Int($0)!}.reversed().drop{$0==0}.reversed()},a=x($0),b=x($1)
return a==b ?nil:a.lexicographicallyPrecedes(b)}
```
[Try it online!](https://tio.run/##ZVLPa4MwFL73r8hCDwbcaxS7allaGOyw22DH0kNqYytkKtFtHeLf7hKj1naiJF@@H@89SfmTJlXQSlGhZO18VCrNTq5dyOPmJc/lFjHU1kZwGQSa2b1l1Z7VcwplIdNKbxjDgBv45EWtOWdOyUMDSnwLVYqjQ@Co8qKT0elx43J2MWL3YFaPzJSovlSGOGMHtM1SueYgxSWN85PixTmNuZS/70rE4ihK50CadjdzsI9dNDzYw8RdLEa80bwHFGivueeZ5ceEXjxqLO9D0Bex4Bpi8z1YPq3CSEs6fuJ/tvxYwPDTDqzfn/Le8t4fAg3G/kMIJgGmvxXQsYAG4f98PRLYKQ2g5u27MPn2gHomAlMrHjKM3x70@RNu6C/wrz8QB7fzG38URaC/TjKAIcX4fWomDLsaA7jW388gydUrj8@oRoW@geZ6uWjuabE2JD0iBDXtHw "Swift 4 – Try It Online")
### Explanations
* We trim trailing .0.
* We compare components numerically.
### Returned constants
* nil for =
* true for <
* false for >
[Answer]
# JavaScript 64 bytes
```
a=>b=>(e=i=>(g=v=>v.split`.`[i]||0)(a)-g(b)||!a[i]-1&&e(i+1))(0)
```
[Try it online!](https://tio.run/##fZLRboMgFIbv9xSMiwayeALGTs2GyZ5jWVLbUsNiqhPnle/uENSqrTNqOJyP/5zzh@@0SfWpUmXtXYuz7C6iS0VyFAmRQpl/JhqRNKDLXNUHOHyqr7ZllKTUy8iRtu1zarY8vttJol44pYTRLtVaVjUSqJI/v6qSBLsdTN@e3IpcCPYxReNDMMfjmqIEsQXJgQEb6CUphLhnJ93x5DbrQzC0MURW/FEHHPavYRQb2JGj6vs9OTVgSbw9lb8g@X5TMwIW3OaPIMCb84fA@M2rECL8r6vg/LIR69/ejnV9l2G8lzWRO4cfabrMWN1Rj2cKfJhNH8wcXWvGcQzms/AU2SprTZ/1TkU2N0WzPk/FVRe5hLzICP7Ic1RLXWtU9gpnczm7Pw "JavaScript (Node.js) – Try It Online")
With comments:
```
a=>b=>(                            // Main function takes arguments like ("1.2.42")("1.2.41")
    e=i=>                          // e(i) compares the ith number, returns >0, <0 or =0.
        (   g=v=>v.split`.`[i]||0  // g() returns the ith string or 0
        )(a)                       // call g(a)
        -g(b)                      // subtracting g(b) from g(a) casts strings to integer
        ||                         // If they are not equal return result now
        !a[i]-1 &&                 // recursion limited to a.length, always sufficient
        e(i+1)                     // next i
    )(0)                           // Start with i = 0
```
[Answer]
# [Perl 5](https://www.perl.org/), 55 bytes
```
sub c{@_<2?sprintf"%9d"x9,split/\./,pop:-(c(pop)cmp c(pop))}
```
[Try it online!](https://tio.run/##xY/fboIwFMbv@xQnDBOalFoaVFDAmex6u9mlCVHsnPEfsxhdCM/OWqDE7QXW0PLrd76efs3F5TCq5XUNWV0@pxGfy/yyOxUf1iDcWPeQyPywK4ZLOiT5OZ@6TuaoP86OObSEq/rpcj1BIWQhIVtJIdHtc3cQTvSyeF8kuEQAx2/HXhF7TWxB7C2Om6YzVXA6wSm/bk4ErgcxMEjAw5WblLaoSNaexFjbTTR3LGHghhK6VdxzkRVio7ZcbbfnoqHlySLqhji2t3PrbW9NrVdVOe8tTB7izFCF0lSHTVP4t4F4j15PCfIoo@yPGmvVePu6Vjn1easq8kwHj47GkyBs1NYbaZWZDvzhNt6r3qj3BpT5rRpQ32SYUNa1mNDgd16q86nJ9MdVh5aYSsTaeuM1pFXzugj5JiT4fd4EhWFI1VTckToRIc50tkBxR423/gE "Perl 5 – Try It Online")
[Answer]
## Burlesque - 17 bytes
```
wd{'.;;)ri}m[^pcm
blsq ) "2018.08.1 2018.08"wd{'.;;)ri}m[^pcm
1
blsq ) "0.0.1 0.1"wd{'.;;)ri}m[^pcm
-1
blsq ) "1.1.56789 1.2.0"wd{'.;;)ri}m[^pcm
-1
```
If you want output in '><=' then add `?i"<=>"j!!Q`. 
[Answer]
# Powershell, 88 bytes
Returns `0` for equal, a `positive integer` for greater than or a `negative integer` for less than.
```
param($a,$b)+(($x=$a-split'\.')+($y=$b-split'\.')|%{$x[+$i]-$y[$i++]}|?{$_}|Select -f 1)
```
Less golfed test script:
```
$f = {
param($a,$b)
$x=$a-split'\.'
$y=$b-split'\.'
$z=$x+$y|%{
    $x[+$i]-$y[$i++]
}|?{$_}|Select -first 1
+$z             # convert $null to 0
}
@(
    ,("2"         ,"1"         , 1)
    ,("1.0.0"     ,"1"         , 0)
    ,("1.0"       ,"1.0.0"     , 0)
    ,("1.2.42"    ,"1.2.41"    , 1)
    ,("1.1.56789" ,"1.2.0"     ,-1)
    ,("1.10"      ,"1.2"       , 1)
    ,("1.20"      ,"1.150"     ,-1)
    ,("18.04"     ,"18.4"      , 0)
    ,("7.010"     ,"7.8"       , 1)
    ,("1.0.0.1.0" ,"1.00.00.2" ,-1)
    ,("00.00.01"  ,"0.0.0.1"   , 1)
    ,("0.0.1"     ,"0.1"       ,-1)
    ,("42.0"      ,"4.2.0"     , 1)
    ,("999.999"   ,"999.999.1" ,-1)
    ,("2018.08.1" ,"2018.08"   , 1)
) | % {
    $v1,$v2,$expected = $_
    $result = &$f $v1 $v2
    "$([Math]::Sign($result)-eq$expected): $result"
}
```
Output:
```
True: 1
True: 0
True: 0
True: 1
True: -1
True: 8
True: -130
True: 0
True: 2
True: -1
True: 1
True: -1
True: 38
True: -1
True: 1
```
[Answer]
# [Dart](https://www.dartlang.org/), ~~277~~ 231 bytes
```
F(s,{t}){t=s.split('.').map(int.parse).toList();while(t.last<1)t.removeLast();return t;}f(a,b,{d,e,f,g,h,i=0}){d=F(b);e=F(a);g=d.length;h=e.length;f=h>g?g:h;for(;i<f;i++)if(e[i]!=d[i])return e[i]>d[i]?1:-1;return h>g?1:(h<g?-1:0);}
```
[Try it online!](https://tio.run/##dVPJboMwEL33K1ypkm3VGdmINiQOyak99Q8QB7cYsJRNYNoD4ttTs5SQJkEwzPJm3vBkElXY0@mdlKy2Da1tWEJ53BpLMGAKO3UkZm/hqIpSU7CHD1NaQuVPbraaWNiq0q4EtVDo3eFbf6iuWmhbFXtkZZMSxT5ZnTDNUpaxnJmQO5YkfCefVGr3UlRmYQJbvc9sLvNQ/7lpmK@zTbZ03qEg0qxSaZ6fqUmJjkz8GCbO0oGpzazbxEYsZ@KPv@0XS5Kvss1MLDmVzWmnzJ7Q@gGhb1Ugi0IUOR@hCHsYDRdDWIxBH8VsQAngwPFNFL9A4XP32HKF8sDvaDuUCwS@xSjg5XUeLPCAOs@aXcLOBQfDd9b3pijxcmdYANwfdwnAx7e@cg5cjFrMIcD3FYNWkV4L3t5uvX@UfZ6LrsD7Hnw1bEz3KDGhnA7zpyr5F5pNUIvFAtyDu/wQgLjazOOtHIGruMIQnDdzoFg@OGvBHdM39ZUTUnUHDKFj4X4dgp/qlFQRj1kViZg2KFyjp7qKvLjBVDpg42xz@gU "Dart – Try It Online")
* -44 bytes by using variables to store length and using ternary in loop
* -2 bytes by removing the for brackets
[Answer]
# [Swift 4+Foundation](https://developer.apple.com/swift/), ~~160 bytes (142+18)~~, 155 bytes (142+13)
### Import (13 bytes, including `;` to separate from the code):
This will import Foundation, but is 5 bytes shorter than `import Foundation`.
```
import UIKit;
```
### Header (not counted: the code is non-recursive):
```
let f:(String,String)->ComparisonResult =
```
### Code (142 bytes):
```
{var x={($0 as String).split{$0=="."}.count},a=$0,b=$1
while x(a)<x(b){a+=".0"}
while x(b)<x(a){b+=".0"}
return a.compare(b,options:.numeric)}
```
[Try it online!](https://tio.run/##bVLdaoMwGL33KULwwrAsjWJXLbU3Y3uA7XLsIna6BqxKjGtBfHaXNCZ1P6LIyfn5zid2Z17KeOKnthESPDd9/cEkb2qvKiQot8GrFLz@xOaF7vePzallgndN/VJ0fSVBBqbhiwlwyYbAp4B1YNaSrq24HHyaZZDAkRxUthwxy3yK88wPvfORVwW4BAztLkGOBnanhBSOjsg1wdCQW0IUshc1YCpLtyiCHDetbtttSd2fCsEPaJzevABGEAN7wRAivFo5vFd8SKhKxP/ymeFdwix2GsNHJJ6HGHALMfkhWT9sklRJrvzCvzO8G6D5ZQPjj5Z8uP7tTwiNXf@ExIsA3W9DqBugQPI3X61EzJYaUH3PLXS@OaChjoDUiG2G9puDOX/B2X5xdPuAMP65v/anaUrUc5VYYFO0P6J6w@Q6w4Lb/HePlI14YocjGECr/japfj0M/FCJlaGcEUJgnL4B "Swift 4 – Try It Online")
### Explanations
1. We append some trailing .0 for same number of components.
2. We compare components numerically.
### Returned constants
* ComparisonResult.orderedSame for =
* ComparisonResult.orderedAscending for <
* ComparisonResult.orderedDescending for >
[Answer]
# [Zsh](https://www.zsh.org/), ~~54~~ 50 bytes
***-4 bytes** by using `$@` instead of `$1\ $2`*
```
eval {autoload,}' is-at-least $'{@,2\ $1}';<<<$?;'
```
~~[Try it online!](https://tio.run/##qyrO@P8/tSwxR6E6sbQkPyc/MUWnVl0hs1g3sUQ3JzWxuERBRb3aMEZBxUjHCEga1qpb29jYqNhbq////99QzwAIgSSIZQBCRgA "Zsh – Try It Online")~~
[Try it online!](https://tio.run/##XY/NaoQwFIXX5ikugxCFMSTBqb@l3ZRuCt111U1sIjMgE1DbRcVnt9GYTJlLAifHLyfH3@G8tFEcLepHdDCJ71F3WsjjjOEyJGJMOiWGEUI8PR/5J4RsxlVd1@FThZcYoVb3IKABCREKOLhhXr2igBFK6J39stmO9sBmc5JyaxvFfAgjp4csLzbb0m@bTV0I//8k9zY73eic0NTaOUl9k4zQPSUj@V1vstY0m66LryFWUlOMWsDSTq62@09Dp64spL63oYuiIGabw67MHUNzulbMzWFXGx1XIDUK1NdZw@FD9cNFX4cSwinqS0bLWMw33cwHR773UvUmwJDSmThxg1HQQiggbNynRzcYSX1Vyx8 "Zsh – Try It Online")
This `eval`s to the following eight statements:
```
autoload is-at-least $@       # loads the "is-at-least" function
<<<$?                         # success, prints 0
autoload is-at-least $2 $1    # redundant
<<<$?                         # success, prints 0
is-at-least $@                # exits 1 if $1 < $2
<<<$?
is-at-least $2 $1             # exits 1 if $2 < $1
<<<$?
```
So the three unique values are:
```
 cmp |  value
-----+------------------------------------------
  =  |  0<newline>0<newline>0<newline>0<newline>
  <  |  0<newline>0<newline>1<newline>0<newline>
  >  |  0<newline>0<newline>0<newline>1<newline>
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
ṣ€”.Vz0I¬ÞḢ
```
[Try it online!](https://tio.run/##XY@xCsIwEIb3PoWDi8txCdGm0HYXnH0DF3Fw1UldHNwUxEFFdHVUsXSr6HukLxIvpglqyMHPd/9d/vR7g8FIa5Wdytm5nOygO8Z2cX7s1f2oVX4prkk5vdWfq2FdZevOa/6Yq@yg8kU52cZpQhON51JlG615zR3mVRowQMA/mhjqvL5vKAfBLSXF3AYGzVYoow@13thQdBv412vcU9b0XgkoLJUgXIYQsFoRgvzNCyYfFZrLaYNVSInQ9j9epwx1v4sD4ULWhM@bBlEUARXpStFEHHA02STpShnvGw "Jelly – Try It Online")
May be stretching the rules a little, but going by [this](https://codegolf.meta.stackexchange.com/a/11884/66833) I/O default, it's allowed. This uses the output presentation:
> 
> Use positive number / zero / negative number, while zero means equal;
> 
> 
> 
but the output is wrapped as a singleton array
## How it works
```
ṣ€”.Vz0I¬ÞḢ - Main link. Takes a pair of versions [a, b] on the left
 €          - Over each:
ṣ ”.        -   Split on "."
    V       - Evaluate each numeric string to a number
     z0     - Transpose, filling with 0s
       I    - Take the differences of each pair
        ¬Þ  - Sort by logical NOT
              This shuffles 0 to the end and preserves the order of everything else
          Ḣ - Take the first element
```
[Answer]
# [Perl 5](https://www.perl.org/) `-plF\.`, 50 bytes
```
@b=<>=~/\d+/g;1while@F+@b&&!($_=shift@F<=>shift@b)
```
[Try it online!](https://tio.run/##K0gtyjH9/98hydbGzrZOPyZFWz/d2rA8IzMn1cFN2yFJTU1RQyXetjgjM63Ewc3G1g7CStL8/99Qz0APiLmg9L/8gpLM/Lzi/7oFOW4xegA "Perl 5 – Try It Online")
Takes input on two lines.
| Output | Meaning |
| --- | --- |
| 1 | First version is greater |
| 0 | Versions are equal |
| -1 | Second version is greater |
 ]